Optimising Windows 2012R2 for web hosting

nrep

Member
Joined
Mar 9, 2015
Messages
5
Location
UK
Hello!

I found this excellent forum via XenForo and thought I should sign up for some advice :).

I run a fair number of sites on a Windows 2012R2 server, including a few XF forums. I've noticed that their page generation times (as seen in debug mode) are anything from 0.2-0.4s on most pages. This seems significantly higher than other sites, so I'm trying to improve things.

The server is moderately powerful and CPU/Disk loads are nowhere near the limits, even at busy times:

Dual Processor Hex Core Xeon 2620
32GB DDR4
RAID 1 - 2 x 400GB SSD
Plesk 12

I'm currently getting MySQL specific advice on the XF forums (here), but I bet there is plenty I can do to tweak IIS at the same time.

I'm running the PHP 5.5, MySQL 5.6 and have OpCache and WinCache enabled, both get very good hit rates and reduce loading times significantly.

Is there anything else I can do to optimise load times? Perhaps I'm just at my limit and need more memory for the MySQL buffer pool, but I thought I'd ask to check anyway :).
 
Pick one opcache and use it. I have used wincache and switched to opcache a couple years ago. Getting much better performance.

Turn on compression for static and dynamic content.

Turn on output caching for css, js, and all image extensions. Use both kernel mode and user mode and set cache timeout to like 2 weeks.

Run each website in it's own app pool. Windows 2012 will make you do this.

Optional install memcache and setup xenforo to store sessions and other data.

Don't pay too much attention to load times. Windows app pools timeout if there is no activity. So sites with not much activity will have a higher initial load time while the app pool initializes. On subsequent page loads things will speed up significantly. Sites that are active will not see this as the app pool will remain in memory.

This site runs on Windows 2012 r2 as do all 3 of my sites. I switched from Redhat 12 years ago and haven't looked back.
 
Thanks AWS :). I'm using Zend OpCache as the Opcache and Wincache only for the rest of the optmisations (as recommended here: http://forums.iis.net/t/1201106.aspx?WinCache+1+3+5+release+on+SourceForge ) - should I just remove Wincache entirely?

I've got those compression and output caching settings already, but all my sites are in 1 application pool as that's how Plesk has it configured. If I separate them in to individual pools will that give a performance boost? If so, I'll do that :).
 
Yes it will boost performance. I wonder how Plesk bypasses the default way IIS manager adds websites. You have to create a new app pool for each site.

Open IIS manager and right click application pools. Select create new app pool. Name it what you'd like.
Then click on your website and select basic setting on far right. Change the app pool to the one you just created.

I removed wincache because it was segfaulting a few times a day. It would cause sites to slow down. I could tell when it happened because the sites would lag when loading each new page.
 
OK, I'll give it a try - there is an option within plesk to provide all sites with their own app pool.

I've temporarily disabled WinCache too, so I'll see how that goes. It was segfaulting for me too, but when I disabled the Opcode Caching and just used the File Caching features of WinCache it was fine. Zend OpCache works great.
 
I used wincache for a while. Started with early beta when I was more active on the IIS forum. I even wrote up an article on it. The problems started to appear at version 1.2. I don't knw what changed, but, many had the same problems with segfaults. It got to the point were it would also take down IIS. I haven't used it since.
 
Any chance I could see your PHP.ini variables to see if I can drop that in and use the same settings? It looks like I can rule out MySQL as a cause of slowness from page rendering, so I assume it must be IIS/PHP:

Page Time: 0.5102s
Memory: 3.6099 MB (Peak: 10.4630 MB)
Queries (14, time: 0.0160s, 3.1%)
 
Thanks! That's very helpful - I'll have a browse now and see how it performs.

Do you have any AV software running? I've got McAfee AV Scan install (with lots of exclusions for DB stuff, etc...) and I wonder if that could be the culprit.
 
Back
Top