online prescription solutions
online discount medstore
pills online
buy lorazepam without prescription
xanax for sale
buy xanax without prescription
buy ambien without prescription
ambien for sale
buy modafinil without prescription
buy phentermine without prescription
modafinil for sale
phentermine for sale
lorazepam for sale
buy lexotan without prescription
bromazepam for sale
xenical for sale
buy stilnox without prescription
valium for sale
buy prosom without prescription
buy mefenorex without prescription
buy sildenafil citrate without prescription
buy adipex-p without prescription
librium for sale
buy restoril without prescription
buy halazepam without prescription
cephalexin for sale
buy zoloft without prescription
buy renova without prescription
renova for sale
terbinafine for sale
dalmane for sale
buy lormetazepam without prescription
nobrium for sale
buy klonopin without prescription
priligy dapoxetine for sale
buy prednisone without prescription
buy aleram without prescription
buy flomax without prescription
imovane for sale
adipex-p for sale
buy niravam without prescription
seroquel for sale
carisoprodol for sale
buy deltasone without prescription
buy diazepam without prescription
zopiclone for sale
buy imitrex without prescription
testosterone anadoil for sale
buy provigil without prescription
sonata for sale
nimetazepam for sale
buy temazepam without prescription
buy xenical without prescription
buy famvir without prescription
buy seroquel without prescription
rivotril for sale
acyclovir for sale
loprazolam for sale
buy nimetazepam without prescription
buy prozac without prescription
mogadon for sale
viagra for sale
buy valium without prescription
lamisil for sale
camazepam for sale
zithromax for sale
buy clobazam without prescription
buy diflucan without prescription
modalert for sale
diflucan for sale
buy alertec without prescription
buy zyban without prescription
buy serax without prescription
buy medazepam without prescription
buy imovane without prescription
mefenorex for sale
lormetazepam for sale
prednisone for sale
ativan for sale
buy alprazolam without prescription
buy camazepam without prescription
buy nobrium without prescription
mazindol for sale
buy mazindol without prescription
buy mogadon without prescription
buy terbinafine without prescription
diazepam for sale
buy topamax without prescription
cialis for sale
buy tafil-xanor without prescription
buy librium without prescription
buy zithromax without prescription
retin-a for sale
buy lunesta without prescription
serax for sale
restoril for sale
stilnox for sale
lamotrigine for sale

Improve page load time and increase server capacity by doing simple DNS and server changes


Problem:

One of the sites I maintain has been getting more and more traffic everyday. A very good thing for the site, not so good for the solo server which is serving those pages. The site is VERY dynamic with LAMP setup. We only have one server serving our web pages to our users. Since its a dynamic site with PHP and MySQL, it has a lot of load during peak times. Average load time of a page is between 1-2 secs during normal usage, 2-5 secs under average to heavy load.

During heavy load, we started to see our mysql stop responding to requests which is a big concern for us since we don’t show content if there is no db connection. We had to come with a solution, fast, to prevent this issue from appearing.

Solution:

So here are couple things I ended up doing on the server side to reduce load on this server without having to do much code change.

  • We have couple other servers at the same location for doing other tasks. So I decided to use one of those servers to offload some of the http processing. I setup our dns to point js.domain.com and css.domain.com to go to this spare server which reduced load on our main server quite a bit. We have a lot of js and css content which is loaded every time user hits a page. Our development team took care of the including the domain in the part where it loads js/css on the page. Another benefit of doing this was to allow users’ browsers to simultaneously download from two servers at a time which in turn equates to load time decrease. Browsers only do certain # of connection per server and wait until those requests are completed before making another request. I believe both FF and IE have limit of 2 per domain.
  • Second thing I did was to turn on compression at Apache level to decrease the amount of traffic sent to users. As long as users browsers support compression, apache would server compressed content. Doing this more than halved our bandwidth usage. We went from doing about 20-25 gigs/day to about 11-13 gigs.

As of now our load has been low even during high traffic times. Our bandwidth usage is low and going up with traffic as expected. Users have to wait 1-2 secs during high traffic times compared to 2-5 secs before tweaking. And during normal usage, we barely see 2 sec page load time instead its mostly only 1 sec. As of writing of this blog, we currently have 12781 users on-line with 90 sql queries per sec on average.


No comments yet. Be the first.

Leave a reply

*
To prove that you're not a bot, enter this code
Anti-Spam Image