Knowledgebase

High Traffic Website Configuration Help Please!

Posted by AmishPatel, 09-09-2009, 04:59 PM
Hi Guys, Some people have complained about not being able to access my site and I believe it's probably to do with the configuration of Apache. Here are some details on the server: - Website utilizes WordPress and has various different plug-ins. - Daily traffic is around 12,000 uniques and 80,000 + page views with around 100-400 visitors trying to access the Website at any one time. - Heavy use of PHP/mySQL Below are my.cnf stats: [mysqld] skip-external-locking skip-slave-start skip-bdb skip-innodb skip-name-resolve # Global mem settings key_buffer = 24M max_connections = 200 # Per client mem settings sort_buffer_size = 4M read_buffer_size = 4M binlog_cache_size = 2M max_allowed_packet = 12M thread_stack = 128K table_cache = 128 thread_cache = 256 thread_concurrency = 4 myisam_sort_buffer_size = 1M tmp_table_size = 12M max_heap_table_size = 12M wait_timeout = 200 interactive_timeout = 300 max_connect_errors = 10000 query_cache_type = 1 query_cache_limit = 1M query_cache_size = 16M [mysqldump] quick quote-names max_allowed_packet = 16M Below are my http.conf stats: ErrorLog "logs/error_log" DefaultType text/plain KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 2 MinSpareServers 10 MaxSpareServers 40 MaxRequestsPerChild 100 MaxClients 150 StartServers 40 Thanks guys, just looking for some advice as I really don't have any idea if these are optimum settings. Here are some real-time TOP statistics: top - 15:58:12 up 1 day, 7:04, 2 users, load average: 0.96, 0.99, 1.09 Tasks: 179 total, 1 running, 160 sleeping, 18 stopped, 0 zombie Cpu(s): 18.5% us, 3.5% sy, 0.0% ni, 77.1% id, 0.9% wa, 0.0% hi, 0.0% si Mem: 4147160k total, 2849924k used, 1297236k free, 303488k buffers Swap: 2040212k total, 208k used, 2040004k free, 1811064k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 9338 nobody 16 0 47148 20m 12m S 19.9 0.5 0:02.98 httpd 9375 nobody 16 0 47468 21m 12m S 16.3 0.5 0:02.23 httpd 5771 mysql 15 0 73640 44m 2620 S 14.0 1.1 215:27.03 mysqld 9297 nobody 15 0 47460 21m 12m S 8.6 0.5 0:03.80 httpd 9372 nobody 17 0 47396 21m 11m S 7.6 0.5 0:00.62 httpd 9346 nobody 16 0 47104 20m 12m S 4.7 0.5 0:03.55 httpd 9317 nobody 15 0 47420 22m 13m S 4.0 0.6 0:02.83 httpd 9306 nobody 16 0 47424 21m 12m S 3.0 0.5 0:04.44 httpd 9319 nobody 16 0 47412 21m 12m S 3.0 0.5 0:04.79 httpd 9295 nobody 16 0 47472 21m 12m S 2.3 0.5 0:03.45 httpd 9301 nobody 15 0 47476 22m 13m S 1.0 0.6 0:05.86 httpd 9322 nobody 15 0 47436 22m 13m S 1.0 0.6 0:04.41 httpd 8372 root 16 0 3432 1080 772 R 0.7 0.0 0:13.71 top 9327 nobody 15 0 47144 20m 12m S 0.7 0.5 0:02.02 httpd 9384 nobody 15 0 45888 10m 3256 S 0.7 0.3 0:00.02 httpd 9383 nobody 16 0 46428 18m 10m S 0.3 0.5 0:00.09 httpd

Posted by activelobby4u, 09-09-2009, 05:04 PM
I suggest enabling the suphp to distinctively identify who is abusing the resource and then you can take the optimization steps .

Posted by AmishPatel, 09-09-2009, 05:13 PM
How come you're assuming PHP is being abused? Also, how would I go about enabling suphp..

Posted by activelobby4u, 09-09-2009, 05:17 PM
I am "assuming" due to that statement. , but yes, it need'nt be true in your case To compile php with suphp follow th simple steps described in http://www.webhostingtalk.com/showthread.php?t=574101

Posted by AmishPatel, 09-09-2009, 05:20 PM
Ah right, I thought that may have been because of the maxclients set or something as the errors they get are about not being able to connect to the site. I will have a look at that link - thank you. Any suggestions on the other settings would be appreciated!

Posted by nomankhn, 09-09-2009, 05:43 PM
Please can you tell us? 1. what is your current database size. 2. How many total number tables you have? 3. How much total RAM you have? 4. what about your operating system ? Centos?

Posted by AmishPatel, 09-09-2009, 05:58 PM
Yes sure. 1) 20MB 2) 50 Tables 3) Full Server Stats - Intel Dual Xeon 2.8GHz Processor, 4GB Ram, cPanel, Enterprise Linux - OS

Posted by nomankhn, 09-09-2009, 06:29 PM
I suggest you have to view below links. http://www.learn-mysql-tutorial.com/TuneMySQL.cfm http://2bits.com/articles/mysql-my-c...upal-site.html Also i suggest implement 1. implement slow query so you can analyze more detail. 2. Also try to implement indexing, that will give you speed up your database. 3. block all incoming mysql request to 3306 only open for localhost.

Posted by The Universes, 09-09-2009, 06:38 PM
Are you using the WP-Supercache plugin with Wordpress? That dramatically reduces server (and MySQL) load. Grab a copy of Turning Primer: http://www.day32.com/MySQL/tuning-primer.sh That will give you some detailed information and recommendations on configuration values.

Posted by AmishPatel, 09-09-2009, 06:53 PM
yeh using wp-supercache//

Posted by rickb12, 09-09-2009, 07:02 PM
Is it possible that the delays are due to hard drive wait times? It might not be a bad idea to run iostat during peak usage times. http://linuxcommand.org/man_pages/iostat1.html

Posted by AmishPatel, 09-09-2009, 07:10 PM
Hey, I've run that and everything has looked ok during peak times. Based on my memory/swap, I think I had maxclients set quite low. Just been reading and changed settings to the following: Timeout 300 KeepAlive On MaxKeepAliveRequests 2 KeepAliveTimeout 10 MinSpareServers 16 MaxSpareServers 64 StartServers 8 MaxClients 600 MaxRequestsPerChild 1000 Anyone advise on this?

Posted by PeakVPN-KH, 09-10-2009, 01:10 AM
As mentioned above, implement suphp and that will help pinpoint the exact cause. Right now, you're going to have to dig through, tail logs, watch io/cpu... It's just easier to implement suphp and monitor usage by user. You could also use fcgi and easily implement user limits.

Posted by Laxman Bhattarai, 03-31-2011, 11:52 AM
I also have a Website It's news portal and it's have high traffic. My server configuration is WHM 11.28.87 CENTOS 5.5 x86_64 standard 8GB Ram. It's dedicated Server. SO what should be the good httpd/mysql configuration for it. It's only one High Traffic site. Thank you, Laxman



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
using windows 7 (Views: 610)
Static IP (Views: 580)
Forced Ads by Reseller (Views: 597)


Language:

Client Login

Email

Password

Remember Me

Search