Speed up your site

When your site relies on a lot of external API’s, has a lot of JavaScript, images, Redis cache… and which site doesn’t have most of these things these days, the loading of a page might go slower than you would like, even with extensive caching.

There are a few things that I found can speed up your site considerably, all having to do with the amount of threads and connections.

Increase the maximum amount of connections that can be made simultaneously in your web.config, default is 2 if I remember correctly.

add address=”*” maxconnection=”48″

Optimize the free threads that should be available in your web.config.

httpRuntime minFreeThreads=”352″ minLocalRequestFreeThreads=”304″ targetFramework=”4.6.1″ requestValidationMode=”2.0″ maxRequestLength=”1048576″ executionTimeout=”900″

Optimize the worker and iocp threads, which should be done in the global asax.

ThreadPool.SetMinThreads(workerThreads, iocpThreads);
ThreadPool.SetMaxThreads(workerThreads, iocpThreads);

The settings vary with the amount of CPU’s, but these worked very well for sites hosted in Azure.

You can read more about it here. The complete solution is in a gist.

3 thoughts on “Speed up your site

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s