Results 1 to 9 of 9
-
05-30-2010, 12:12 AM #1Web Hosting Master
- Join Date
- Apr 2005
- Location
- Under The Floor Tiles
- Posts
- 566
Optimizing nginx for a VPS environment
I have a small dynamic web site (Wordpress) that I run on a VPS.net server with 376MB RAM. Web serving is the only thing the server in question does, as I've offloaded the database to another geographically separate VPS node.
I'm stuck between running Apache 2 and nginx. Apache 2 is a royal RAM hog, but nginx is painfully slow on page loads.
So, I decided to objectively test each web server by hammering them both with a 30-second siege of 15 concurrent sessions from my database server. Here are the results when serving via Apache 2:
Code:Transactions: 262 hits Availability: 100.00 % Elapsed time: 29.69 secs Data transferred: 4.04 MB Response time: 1.11 secs Transaction rate: 8.82 trans/sec Throughput: 0.14 MB/sec Concurrency: 9.77 Successful transactions: 262 Failed transactions: 0 Longest transaction: 1.63 Shortest transaction: 0.86
Code:Transactions: 150 hits Availability: 100.00 % Elapsed time: 30.14 secs Data transferred: 2.56 MB Response time: 2.34 secs Transaction rate: 4.98 trans/sec Throughput: 0.09 MB/sec Concurrency: 11.67 Successful transactions: 150 Failed transactions: 0 Longest transaction: 3.06 Shortest transaction: 1.10
"When a man begins to doubt himself, he does something incredibly stupid and thereby is reassured."
::http://www.dustytech.net/:: Personal Website
-
05-30-2010, 12:30 AM #2Web Hosting Evangelist
- Join Date
- Oct 2006
- Location
- canada
- Posts
- 529
Posting just the results doesn't really say much. You need to at least post the relevant worker/prefork section of Apache config and likewise the core of nginx config and the FCGI settings.
-
05-30-2010, 12:40 AM #3Web Hosting Master
- Join Date
- Apr 2005
- Location
- Under The Floor Tiles
- Posts
- 566
Apache worker:
Code:<IfModule mpm_worker_module> StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 </IfModule>
Code:user www-data; worker_processes 2; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; access_log /var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; gzip on; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; }
"When a man begins to doubt himself, he does something incredibly stupid and thereby is reassured."
::http://www.dustytech.net/:: Personal Website
-
05-30-2010, 01:00 AM #4Web Hosting Master
- Join Date
- Mar 2008
- Posts
- 1,717
Post the FastCGI settings for PHP from both Apache and nginx.
Unless you're using mod_php, which would explain the boost right there.
Come to think of it, activate caching with a plugin from WP and I bet nginx hauls ass.I used to run the oldest commercial Mumble host.
-
05-30-2010, 01:27 AM #5Junior Guru Wannabe
- Join Date
- Jul 2007
- Posts
- 41
-
05-30-2010, 01:31 AM #6Web Hosting Master
- Join Date
- Apr 2005
- Location
- Under The Floor Tiles
- Posts
- 566
WP Super Cache is installed and working, and brought nginx up to par with Apache in terms of response time.
I'm using mod_php5 on the Apache side, and I'm not sure where to go on the nginx side to see my FastCGI settings. Is that synonymous with fastcgi_param?"When a man begins to doubt himself, he does something incredibly stupid and thereby is reassured."
::http://www.dustytech.net/:: Personal Website
-
05-30-2010, 01:36 AM #7Web Hosting Master
- Join Date
- Nov 2005
- Posts
- 3,944
Most likely the fastcgi config is in /etc/nginx/conf.d/
maybe fastcgi.conf?
-
05-30-2010, 01:40 AM #8Web Hosting Master
- Join Date
- Apr 2005
- Location
- Under The Floor Tiles
- Posts
- 566
I've got this in /etc/default/php-fastcgi:
Code:START=yes # Which user runs PHP? (default: www-data) EXEC_AS_USER=www-data # Host and TCP port for FASTCGI-Listener (default: localhost:9000) FCGI_HOST=localhost FCGI_PORT=8888 # Environment variables, which are processed by PHP PHP_FCGI_CHILDREN=4 PHP_FCGI_MAX_REQUESTS=1000
"When a man begins to doubt himself, he does something incredibly stupid and thereby is reassured."
::http://www.dustytech.net/:: Personal Website
-
05-30-2010, 02:40 AM #9Aspiring Evangelist
- Join Date
- Jan 2010
- Posts
- 389
was that true?
but at our server, seems nginx got better performance.
Similar Threads
-
If I need a help with optimizing a vps where can I get it
By ToBlEr0nE in forum VPS HostingReplies: 10Last Post: 03-03-2010, 09:20 PM -
VPS hosting NGinx Fully spupported?
By roy250 in forum VPS HostingReplies: 5Last Post: 12-03-2009, 02:53 AM -
Optimizing a VPS server
By brkonthru in forum VPS HostingReplies: 6Last Post: 09-17-2008, 07:22 AM -
Shared Hosting Environment: nginx
By LuckyBambu in forum Hosting Security and TechnologyReplies: 0Last Post: 08-02-2008, 11:32 PM -
VPS Optimizing
By GazCBG in forum Hosting Security and TechnologyReplies: 1Last Post: 02-13-2007, 05:49 PM