need some help with mongrel and performance problems

I run a Debian/Etch witch Apache 2.2.3 and self installed Rails 1.2.3.

apache2 configuration:

<Proxy balancer://beta>      BalancerMember http://192.168.178.200:8100      BalancerMember http://192.168.178.200:8101      BalancerMember http://192.168.178.200:8102      BalancerMember http://192.168.178.200:8103      BalancerMember http://192.168.178.200:8104      BalancerMember http://192.168.178.200:8105 </Proxy>

<Virtualhost *:80>         ServerName www.gissmoh.de         ServerAdmin gissmoh@gissmoh.de

        ProxyPass /images !         ProxyPass /stylesheets !         ProxyPass /javascripts !

        ProxyPass / balancer://beta/         ProxyPassReverse / balancer://beta/

        SetEnv force-proxy-request-1.0 1         SetEnv proxy-nokeepalive 1

        # RewriteEngine On         # DirectoryIndex index.html

        ...

bash:

mongrel_rails start -d -p 8100 -e production mongrel_rails start -d -p 8101 -e production mongrel_rails start -d -p 8102 -e production mongrel_rails start -d -p 8103 -e production mongrel_rails start -d -p 8104 -e production mongrel_rails start -d -p 8105 -e production

The website www.gissmoh.de is very, very slow :frowning:

The host is connected via a dyndns.org account and uses a Broadband ADSL connection (512Kbit upstream, 6Mbit downstream).

One year ago I run a PHP application on the same machine and it was a lot faster.

Didn't I get mongrel and apache2 configured right??

Thanx

jochen kaechelin schrieb:

I run a Debian/Etch witch Apache 2.2.3 and self installed Rails 1.2.3.

apache2 configuration:

<Proxy balancer://beta>      BalancerMember http://192.168.178.200:8100      BalancerMember http://192.168.178.200:8101      BalancerMember http://192.168.178.200:8102      BalancerMember http://192.168.178.200:8103      BalancerMember http://192.168.178.200:8104      BalancerMember http://192.168.178.200:8105 </Proxy>

<Virtualhost *:80>         ServerName www.gissmoh.de         ServerAdmin gissmoh@gissmoh.de

        ProxyPass /images !         ProxyPass /stylesheets !         ProxyPass /javascripts !

        ProxyPass / balancer://beta/         ProxyPassReverse / balancer://beta/

        SetEnv force-proxy-request-1.0 1         SetEnv proxy-nokeepalive 1

        # RewriteEngine On         # DirectoryIndex index.html

        ...

bash:

mongrel_rails start -d -p 8100 -e production mongrel_rails start -d -p 8101 -e production mongrel_rails start -d -p 8102 -e production mongrel_rails start -d -p 8103 -e production mongrel_rails start -d -p 8104 -e production mongrel_rails start -d -p 8105 -e production

The website www.gissmoh.de is very, very slow :frowning:

The host is connected via a dyndns.org account and uses a Broadband ADSL connection (512Kbit upstream, 6Mbit downstream).

One year ago I run a PHP application on the same machine and it was a lot faster.

Didn't I get mongrel and apache2 configured right??

Thanx

Here are some entries from the producion log:

Processing BookController#index (for xxxxxx at 2007-06-23 14:04:47) [GET]    Session ID: 5b50e646aafef8c631b694b3883a1280    Parameters: {"action"=>"index", "controller"=>"book"} Rendering within layouts/application Rendering book/index Completed in 0.00887 (112 reqs/sec) | Rendering: 0.00860 (96%) | DB: 0.00000 (0%) | 200 OK [http://www.gissmoh.de/book\]

Processing FlickrController#index (xxxxxx at 2007-06-23 14:05:07) [GET]    Session ID: 5b50e646aafef8c631b694b3883a1280    Parameters: {"action"=>"index", "controller"=>"flickr"} Rendering within layouts/application Rendering flickr/index Completed in 0.00863 (115 reqs/sec) | Rendering: 0.00834 (96%) | DB: 0.00000 (0%) | 200 OK [http://www.gissmoh.de/flickr\]

Processing StartController#index (for xxxxxx at 2007-06-23 14:05:14) [GET]    Session ID: 5b50e646aafef8c631b694b3883a1280    Parameters: {"action"=>"index", "controller"=>"start"} Rendering within layouts/application Rendering start/index Completed in 0.00976 (102 reqs/sec) | Rendering: 0.00957 (98%) | DB: 0.00000 (0%) | 200 OK [http://www.gissmoh.de/\]

jochen kaechelin wrote:

I run a Debian/Etch witch Apache 2.2.3 and self installed Rails 1.2.3.

apache2 configuration:

<Proxy balancer://beta>      BalancerMember http://192.168.178.200:8100      BalancerMember http://192.168.178.200:8101      BalancerMember http://192.168.178.200:8102      BalancerMember http://192.168.178.200:8103      BalancerMember http://192.168.178.200:8104      BalancerMember http://192.168.178.200:8105 </Proxy>

<Virtualhost *:80>         ServerName www.gissmoh.de         ServerAdmin gissmoh@gissmoh.de

        ProxyPass /images !         ProxyPass /stylesheets !         ProxyPass /javascripts !

        ProxyPass / balancer://beta/         ProxyPassReverse / balancer://beta/

        SetEnv force-proxy-request-1.0 1         SetEnv proxy-nokeepalive 1

        # RewriteEngine On         # DirectoryIndex index.html

        ...

bash:

mongrel_rails start -d -p 8100 -e production mongrel_rails start -d -p 8101 -e production mongrel_rails start -d -p 8102 -e production mongrel_rails start -d -p 8103 -e production mongrel_rails start -d -p 8104 -e production mongrel_rails start -d -p 8105 -e production

The website www.gissmoh.de is very, very slow :frowning:

The host is connected via a dyndns.org account and uses a Broadband ADSL connection (512Kbit upstream, 6Mbit downstream).

One year ago I run a PHP application on the same machine and it was a lot faster.

Didn't I get mongrel and apache2 configured right??

A quick firebug analysis shows that most of the time is used fetching CSS and JS files. One way of resolving this is by using multiple asset hosts, a starting point for this could be:

http://www.chadfowler.com/2007/2/18/edge-rails-goody-distributed-asset-hosts

About 100 reqs/sec is very good performance result. For 24h it would be 8640000 request. Not bad...

bigzel schrieb:

About 100 reqs/sec is very good performance result. For 24h it would be 8640000 request. Not bad...

It's a 250 Euro machine:

model : 4 model name : Intel(R) Celeron(R) CPU 2.80GHz stepping : 9 bogomips : 5605.32

Tasks: 104 total, 2 running, 102 sleeping, 0 stopped, 0 zombie Cpu(s): 0.0%us, 0.3%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 1028216k total, 1003548k used, 24668k free, 102856k

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

amavis 18 0 102m 81m 1080 S 0.0 8.1 1:52.33 clamd

amavis 15 0 54348 44m 2504 S 0.0 4.5 0:00.38 amavisd-new

amavis 15 0 53904 44m 2704 S 0.0 4.5 0:01.42 amavisd-new

snort 15 0 46880 44m 3216 S 0.0 4.4 0:03.84 snort

amavis 18 0 51752 43m 2428 S 0.0 4.3 0:03.99 amavisd-new

root 15 0 41968 28m 2476 S 0.0 2.9 0:01.80 mongrel_rails

root 15 0 41828 28m 2468 S 0.0 2.8 0:01.78 mongrel_rails

root 15 0 41696 28m 2464 S 0.0 2.8 0:01.75 mongrel_rails

root 15 0 41700 28m 2472 S 0.0 2.8 0:01.75 mongrel_rails

root 15 0 41668 28m 2464 S 0.0 2.8 0:01.75 mongrel_rails

root 15 0 41564 28m 2464 S 0.0 2.8 0:01.74 mongrel_rails

mysql 15 0 125m 18m 5644 S 0.0 1.8 0:04.36 mysqld

www-data 15 0 24020 9092 4936 S 0.0 0.9 0:01.98 apache2

www-data 15 0 23936 8776 4664 S 0.0 0.9 0:01.33 apache2

www-data 15 0 23948 8732 4656 S 0.0 0.8 0:00.74 apache2

root 18 0 23756 8628 5012 S 0.0 0.8 0:00.60 apache2

www-data 15 0 23804 8608 4640 S 0.0 0.8 0:01.48 apache2

postgrey 18 0 12220 8128 2644 S 0.0 0.8 0:19.51 postgrey

www-data 15 0 23760 7092 3264 S 0.0 0.7 0:00.07 apache2

www-data 15 0 23756 5472 1632 S 0.0 0.5 0:00.01 apache2

www-data 18 0 23756 5296 1524 S 0.0 0.5 0:00.01 apache2

www-data 15 0 23756 5296 1524 S 0.0 0.5 0:00.00 apache2

www-data 15 0 23756 5176 1404 S 0.0 0.5 0:00.01 apache2

www-data 18 0 23756 4868 1252 S 0.0 0.5 0:00.00 apache2

But I think it's too slow to run the rails app here.... I think I must look for a dedicated machine....