Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject:
PostPosted: Thu Dec 10, 2009 2:18 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Apache prefork should be able to handle 10000 hits/day with no trouble. Here are the settings on a CentOS Linode 360 I have running MediaWiki:
Code:
<IfModule prefork.c>
StartServers       8
MinSpareServers    2
MaxSpareServers   10
ServerLimit      256
MaxClients        25
MaxRequestsPerChild  400
</IfModule>

Memory usage:
Code:
             total       used       free     shared    buffers     cached
Mem:           360        309         50          0         28         88
-/+ buffers/cache:        193        167
Swap:          255          0        255

It's been up for 43 days and hasn't hit swap yet.

From your list of enabled services, I have haldaemon, ip6tables, kudzu, mcstrans, and messagebus turned off with no apparent ill effect. Note that I'm not using IPv6, SELinux, or Webmin, so your mileage may vary.


Top
   
 Post subject:
PostPosted: Thu Dec 10, 2009 2:24 am 
Offline
Senior Member
User avatar

Joined: Tue Dec 01, 2009 10:31 pm
Posts: 57
Thanks Lance, I'll give your Apache settings a go and see how it runs tonight.

Thanks all for your help so far, it's definately running on a much smaller footprint now so we'll see how it handles some load...


Top
   
 Post subject:
PostPosted: Thu Dec 10, 2009 2:35 am 
Offline
Senior Newbie

Joined: Wed May 06, 2009 2:49 pm
Posts: 19
Moses wrote:
I guess I shoudl run a few top's through the testing window to see where the RAM is being used..


Yes. And hit "M" (capital) when top is running to sort by RAM usage.


Top
   
 Post subject:
PostPosted: Sun Dec 13, 2009 7:43 pm 
Offline
Senior Member
User avatar

Joined: Tue Dec 01, 2009 10:31 pm
Posts: 57
I've made big progress this weekend. After much deliberation I decided to stick it out and get nginx firing. During this process I found some excellent guides, however most were for Ubuntu so I ended up trashing the CentOS build and am now running Hardy.

With a massive shout out to The_Guv for his excellent guides, I'm running a clean and mean instance of Ubuntu, nginx, PHP5/fastcgi/xcache and the site is flying... well as quick as I could expect from Sydney anyway.

Now I can use that RAM saved by nginx for caching PHP and MYSQL... as soon as I work out how!

I've got the blog and forums firing now, and will probably migrate the live DNS tonight or tomorrow. Here's the top stats sorted by MEM of the system sitting idle:

Quote:
top - 18:06:38 up 7 min, 1 user, load average: 0.04, 0.03, 0.00Tasks: 83 total, 1 running, 82 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 368864k total, 185160k used, 183704k free, 4408k buffers
Swap: 393208k total, 0k used, 393208k free, 97204k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2668 www-data 15 0 61792 31m 13m S 0 8.8 0:00.72 php-cgi
2669 www-data 16 0 55440 22m 11m S 0 6.3 0:01.07 php-cgi
2287 mysql 15 0 124m 17m 5004 S 0 4.8 0:00.11 mysqld
2667 www-data 15 0 48080 14m 9696 S 0 4.0 0:00.22 php-cgi
2670 www-data 18 0 59008 12m 6516 S 0 3.5 0:00.04 php-cgi
2617 www-data 21 0 46560 9168 6120 S 0 2.5 0:00.06 php-cgi
2671 www-data 18 0 46824 4708 1300 S 0 1.3 0:00.00 php-cgi
2672 moses 17 0 5572 3068 1404 S 0 0.8 0:00.12 bash
2609 www-data 15 0 4916 1636 752 S 0 0.4 0:00.00 nginx
2107 root 16 0 2476 1168 904 S 0 0.3 0:00.00 login
2697 moses 15 0 2220 1076 832 R 0 0.3 0:00.02 top
2610 www-data 15 0 4596 1064 436 S 0 0.3 0:00.00 nginx
2611 www-data 15 0 4596 1064 436 S 0 0.3 0:00.00 nginx
2612 www-data 15 0 4596 1064 436 S 0 0.3 0:00.00 nginx
2166 klog 17 0 2128 1024 392 S 0 0.3 0:00.00 klogd
2187 root 18 0 5220 968 616 S 0 0.3 0:00.00 sshd
1 root 15 0 1956 964 528 S 0 0.3 0:00.00 init



Do the above figures look reasonable? Are there any decent load testing apps that I could use to stress the site and see how she rolls?

Thanks for all the advice to date, it's been educational!


Top
   
 Post subject:
PostPosted: Mon Dec 14, 2009 1:04 am 
Offline
Senior Member

Joined: Thu May 21, 2009 3:19 am
Posts: 336
You can run ab (apachebench) to load test the site:
http://www.claytonlz.com/index.php/2008 ... -to-nginx/

http://httpd.apache.org/docs/2.0/programs/ab.html


Top
   
 Post subject: Go Live!
PostPosted: Tue Dec 15, 2009 8:43 am 
Offline
Senior Member
User avatar

Joined: Tue Dec 01, 2009 10:31 pm
Posts: 57
Thanks Waldo, those ab tests were great, managed to serve 99% of 10,000 pages < 5 secs!


I did my big server move tonight and it all seems to have gone smoothly so far, and damn it FLIES! Well, it could well slow down a lot once the users get on there, but for now I'm loving it.

I've noticed a bunch of permissions related errors, and have been slowly rectifying these with chmod's. Is there a way to export all the chmod's from my old (dreamhost) server to the VPS? Well that's assuming they were correct in the first place, but it's a starting point at least.

Also, I thought I'd update Wordpress however the automated login seems to not be working. I've set it to use IP.ADD.RE.SS:PORT as well as my SFTP details (that work in FileZilla from home) and get:
Quote:
Error: There was an error connecting to the server, Please verify the settings are correct.


Finally, I've got huge amounts of RAM free, should I be looking to increase mysql cache or something to use some of this up?
Quote:
$ free -m
total used free shared buffers cached
Mem: 360 256 103 0 30 109
-/+ buffers/cache: 116 243
Swap: 383 0 383

$ top
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2429 www-data 18 0 63080 39m 20m S 0 11.1 0:12.34 php-cgi
2430 www-data 16 0 55416 28m 16m S 0 7.8 0:14.58 php-cgi
2432 www-data 16 0 52356 24m 15m S 0 6.8 0:12.81 php-cgi
2433 www-data 16 0 51552 24m 15m S 0 6.7 0:13.61 php-cgi
2431 www-data 16 0 51548 22m 14m S 0 6.3 0:10.99 php-cgi
2271 mysql 15 0 158m 20m 5200 S 0 5.8 0:03.27 mysqld
2385 www-data 22 0 46560 9188 6136 S 0 2.5 0:00.03 php-cgi
2562 root 15 0 6816 4952 1544 S 0 1.3 0:00.01 munin-node
2685 moses 15 0 4440 3024 1268 S 0 0.8 0:00.11 bash
2563 root 16 0 7808 2376 1940 S 0 0.6 0:00.03 sshd
4092 root 16 0 7804 2224 1800 S 0 0.6 0:00.04 sshd
11881 postfix 16 0 5440 1936 1584 S 0 0.5 0:00.00 smtp




Cheers,
Moses.


Top
   
 Post subject: Re: Go Live!
PostPosted: Tue Dec 15, 2009 11:27 am 
Offline
Senior Member

Joined: Mon Dec 07, 2009 6:46 am
Posts: 331
Moses wrote:
Finally, I've got huge amounts of RAM free, should I be looking to increase mysql cache or something to use some of this up?


SMF has memory caching capabilities, with memcached, APC and I believe even XCache, the last two also being opcode cachers. I'm assuming you're using one of them.


Top
   
 Post subject:
PostPosted: Tue Dec 15, 2009 8:33 pm 
Offline
Senior Member
User avatar

Joined: Tue Dec 01, 2009 10:31 pm
Posts: 57
I'm getting an nginx error when a user posts a comment to the blog, though the comment does still post...

Quote:
502 Bad Gateway
nginx/0.7.62


Should I have chown'ed anything to www-data

Here's my nginx.conf
Quote:
user www-data www-data;
worker_processes 4;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

sendfile on;
tcp_nopush on;
tcp_nodelay off;
keepalive_timeout 5;

gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml applic
ation/xml application/xml+rss text/javascript;

include /usr/local/nginx/sites-enabled/*;
}


Thanks for any tips,
Moses.


Top
   
 Post subject:
PostPosted: Tue Dec 15, 2009 8:57 pm 
Offline
Senior Member
User avatar

Joined: Tue Dec 01, 2009 10:31 pm
Posts: 57
I just found my nginx error.log which had some interesting info in it

Quote:
2009/12/16 11:47:09 [error] 12081#0: *1145 recv() failed (104: Connection reset by peer) while readi
ng response header from upstream, client: 221.133.197.254, server: www.domain.com, reques
t: "POST /wp-comments-post.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.greenandg
oldrugby.com", referrer: "http://www.domain.com/ggr-moves-to-our-own-virtual-server/"
2009/12/16 11:47:10 [error] 12081#0: *1109 recv() failed (104: Connection reset by peer) while readi
ng response header from upstream, client: 203.33.167.125, server: www.domain.com, request
: "GET /wp-content/plugins/top-10/top-10-counter.js.php?top_ten_id=7401 HTTP/1.1", upstream: "fastcg
i://127.0.0.1:9000", host: "www.domain.com", referrer: "http://www.domain.com/
"
2009/12/16 11:47:11 [error] 12081#0: *1110 recv() failed (104: Connection reset by peer) while readi
ng response header from upstream, client: 203.33.167.125, server: www.domain.com, request
: "GET /wp-content/plugins/top-10/top-10-counter.js.php?top_ten_id=7294 HTTP/1.1", upstream: "fastcg
i://127.0.0.1:9000", host: "www.domain.com", referrer: "http://www.domain.com/
"
2009/12/16 11:50:15 [error] 12081#0: *1290 recv() failed (104: Connection reset by peer) while readi
ng response header from upstream, client: 150.101.187.176, server: www.domain.com, reques
t: "GET /feed/atom/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.co
m"
2009/12/16 11:55:12 [error] 12083#0: *1457 readv() failed (104: Connection reset by peer) while read
ing upstream, client: 71.235.154.48, server: www.domain.com, request: "GET /feed/ HTTP/1.
1", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com"


Top
   
 Post subject:
PostPosted: Tue Dec 15, 2009 9:39 pm 
Offline
Senior Member
User avatar

Joined: Tue Dec 01, 2009 10:31 pm
Posts: 57
and now, after a reboot, it's all working fine!
strange....


Top
   
 Post subject:
PostPosted: Wed Dec 16, 2009 1:32 am 
Offline
Senior Member
User avatar

Joined: Tue Dec 01, 2009 10:31 pm
Posts: 57
and now... nginx is again giving 502 errors.
Could it be related to a memory problem? Here are my charts from munin where the reboot just after midday on wednesday can be seen..

Image

my nginx error log is filling up again as well...

Quote:
//127.0.0.1:9000", host: "www.***.com", referrer: "http://www.***.com/"
2009/12/16 16:27:27 [error] 2369#0: *11692 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 203.14.52.45, server: www.***.com, request:
"GET /wp-content/plugins/top-10/top-10-counter.js.php?top_ten_id=7364 HTTP/1.0", upstream: "fastcgi:
//127.0.0.1:9000", host: "www.***.com", referrer: "http://www.***.com/"
2009/12/16 16:27:27 [error] 2369#0: *11690 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 203.14.52.45, server: www.***.com, request:
"GET /wp-content/plugins/top-10/top-10-counter.js.php?top_ten_id=7448 HTTP/1.0", upstream: "fastcgi:
//127.0.0.1:9000", host: "www.***.com", referrer: "http://www.***.com/"
2009/12/16 16:27:51 [error] 2369#0: *11720 readv() failed (104: Connection reset by peer) while reading upstream, client: 203.14.52.45, server: www.***.com, request: "GET /wallaby-tight-head-prop-of-the-decade/ HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.***.com", referrer: "http://www.***.com/"
2009/12/16 16:27:53 [error] 2369#0: *11724 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 203.14.52.45, server: www.***.com, request: "GET /wp-content/plugins/top-10/top-10-addcount.js.php?top_ten_id=7367 HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.***.com", referrer: "http://www.***.com/w
allaby-tight-head-prop-of-the-decade/"
2009/12/16 16:27:53 [error] 2369#0: *11724 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 203.14.52.45, server: www.***.com, request: "GET /index.php?ak_action=aktt_css HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.***.com", referrer: "http://www.***.com/wallaby-tight-head-prop-of-the-decade/"


Top
   
 Post subject:
PostPosted: Wed Dec 16, 2009 5:01 am 
Offline
Senior Newbie

Joined: Wed Dec 16, 2009 4:57 am
Posts: 7
Location: Fort Worth, TX
Moses,

Are you still having problems? What size linode are you using?
In your webmin boot up panel, do you have this:
php_cgi Yes Run php-cgi as app server

I swiftly read through your thread, saw you're using NGINX and followed some of theguv's instructions....

You're site is up right now, cached and loading great from Fort Worth, TX.

Cheers!


Top
   
 Post subject:
PostPosted: Wed Dec 16, 2009 7:08 am 
Offline
Senior Member
User avatar

Joined: Tue Dec 01, 2009 10:31 pm
Posts: 57
G'Day eyecool,
Thanks for the response!

I suppose I should have started a new thread when I blew away the CentOS instance and moved to Ubuntu Hardy.. There's too much in this thread now that's no longer relevant, and I don't expect people to read so much dribble!

Yep the site's up and flying, well at least it does for a few hours then certain things start giving nginx 502 errors. Things such as going to the wordpress admin page /wp-admin and leaving a comment on the blog.

The first time it happened I found a restart fixed it. The second time I was able to get it going again with

Quote:
/etc/init.d/php-fastcgi stop
/etc/init.d/php-fastcgi start


I have just re-read the Guv's guide and checked my system to find that I'm using libfcgi0ldbl for fcgi... and I suspect it's the cause of my systems' instability.

Quote:
dpkg -l | grep cgi
ii libfcgi0ldbl 2.4.0-7 Shared library of FastCGI


btw I'm on a Linode 360.


Top
   
 Post subject:
PostPosted: Wed Dec 16, 2009 7:38 am 
Offline
Senior Newbie

Joined: Wed Dec 16, 2009 4:57 am
Posts: 7
Location: Fort Worth, TX
I had the same problem on both my linode and dedicated servers. The following script has kept both servers up and stable for months now: http://bash.cyberciti.biz/web-server/rhel-fedora-php-fastcgi-initd-script/

Also, it will appear in your bootup list in webmin as php_cgi. Make sure it is setup to start on boot. And make sure HTTP is set to not start at bootup.

Glad to see your wordpress site is humming along. I use wordpress mu on a quadcore, 6GB ram, SAS hd. I'm considering switching all to a linode. Testing the response to your site helped my confidence. I think I'd feel safer running a few linodes than my single point of failure dedicated server @ThePlanet.

I also found out that one of the lead wordpress developers and head wordpress mu guru has his site on a linode: http://ocaoimh.ie/

Cheers,

eyecool


Top
   
 Post subject:
PostPosted: Wed Dec 16, 2009 8:20 am 
Offline
Senior Member
User avatar

Joined: Tue Dec 01, 2009 10:31 pm
Posts: 57
Thanks again for the response.

I'm thinking of installing spawn-fcgi rather than the libfcgi0ldbl one from The Guv's guides.

I've gone without webmin after the move to Ubuntu, riding bareback in the console has been an experience! Is this what you're looking for:

Quote:
ps -ef | grep cgi
www-data 18031 1 0 21:07 ? 00:00:00 /usr/bin/php-cgi -q -b localhost:9000
www-data 18034 18031 2 21:07 ? 00:03:00 /usr/bin/php-cgi -q -b localhost:9000
www-data 18035 18031 3 21:07 ? 00:03:16 /usr/bin/php-cgi -q -b localhost:9000
www-data 18036 18031 2 21:07 ? 00:03:05 /usr/bin/php-cgi -q -b localhost:9000
www-data 18037 18031 2 21:07 ? 00:03:02 /usr/bin/php-cgi -q -b localhost:9000
www-data 18038 18031 3 21:07 ? 00:03:24 /usr/bin/php-cgi -q -b localhost:9000
root 28068 17473 0 22:53 pts/0 00:00:00 grep cgi


I haven't installed http, in fact the only part of apache I have got is the apache2-utils for the ab benchmarking.
Quote:
$ dpkg -l | grep http
$


Sounds like a good idea to move to a linode, alas I know far too little to give you any real advice at this point but I like the idea of a few nodes to load balance a busier site.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
RSS

Powered by phpBB® Forum Software © phpBB Group