Portal Home > Knowledgebase > Articles Database > Suggestions for handeling large amount of users in a short time?
Suggestions for handeling large amount of users in a short time?
Posted by Johnburk, 10-07-2010, 04:41 PM |
My server is running a small amount of websites and lately a large website (with over 4 million visitors a day) keeps on linking to one of the sites I manage. This is great, but it does mean that a a huge number of visitors visit the site in a very small site. Usually 4.000 to 6.000 visitors within 5 minutes and about 5.000 within the next hour. After that the link is no longer on the front page and the visitors drop.
This does not happen every day, but 1 to 3 times a month.
What you get is a "digg effect". The first time we actually thought it was an attack.
The website is well cached and according to yslow, the page size is 645 KB on the first visit and 52KB on the second visit, because 593KB is cached.
Mysql seems to be the biggest problem as it cannot handle more connections. Eventually users get a database connection error and that seems to cause a major load.
The current my.cnf is
The server has a dual core CPU and 6GB of ram. With the above config. Total buffers is 546.0M global + 14.2M per thread = max 6.1GB!
Any suggestions, tips, ideas on how I can make the process more smooth and handle more connections?
p.s I see that my title is a bit wrong. It should be
Suggestions for handling large amount of visitor in a short time?
Last edited by Johnburk; 10-07-2010 at 04:45 PM.
|
Posted by Johnburk, 10-07-2010, 05:07 PM |
The server is running CENTOS 5.5 (32bit) with WHM/cPanel and kernel: 2.6.18-194.11.4.el5PAE.
It has PHP 5.2.14 with dso and MySQL version 5.0.91-community-log
|
Posted by zzhosting, 10-08-2010, 01:58 AM |
Hi
What kind of caching are you using ?
what kind of site is it ?
If its off the shelf then there isnt much you can do, if not then you need to see which mysql querys are causing issue (mytop) and then optimize them by adding indexes, or do housekeeping on the tables to make them smaller.
The only other alternative is to move to a better server, with fast disk and more memory.
Good luck.
|
Posted by Johnburk, 10-08-2010, 02:45 AM |
Thank you for your reply zzhosting
The website is a wordpress blog using W3 total cache for miniflying all html, js, css, page caching and browser caching.
The server has php caching with
Zend Engine v2.2.0
- with eAccelerator v0.9.6.1
- with the ionCube PHP Loader v3.3.20
- with Zend Optimizer v3.3.9
Apache has memcache.
I have done my best to cache everything, don't know what to do more.
|
Posted by propcgamer, 10-08-2010, 02:47 AM |
Have you considered setting up a reverse nginx proxy?
|
Posted by sysadm2, 10-08-2010, 03:51 AM |
Could you check the mysql instances or queries related with your domain ? The command below can be used for it.
mysqladmin processlist
If there are unusual connections to any specific, database, check for the queries getting executed and if possible make necessary modifications. Also if the database to which the connections are coming is really huge in size, then necessary memory should be allotted for the queries to get executed without.
Also, have a look in the link. It may help.
http://www.notesbit.com/index.php/we...g-my-cnf-file/
|
Posted by AndyGambles, 10-08-2010, 04:02 AM |
Have you considered using wordpress.com premium hosting rather than your own server? They are specifically configured for high traffic scenarios.
|
Posted by eth00, 10-08-2010, 10:21 AM |
Take a look at varnish, if that much is cached varnish can serve it up quicker then apache and is pretty resource efficient.
|
Posted by Johnburk, 10-08-2010, 10:44 AM |
Had not heard of http://www.varnish-cache.org/ but seems very interesting.
|
Posted by jphilipson, 10-09-2010, 12:07 AM |
It is Check out Unixy's blog for a good idea of just how much faster and more efficient it is
http://www.unixy.net/apache-vs-litespeed/
|
Add to Favourites Print this Article
Also Read