Apache freezing with Passenger

We have a virtual server running CentOS5 and Rails 2.3.5 with Ruby
1.8.7. There are two lightly used rails apps in production on the
server. Every so often, maybe once a month, Apache freezes. A
simple service reset restores service. Has anyone else experienced
such a problem? Any ideas as to what it could be? We’re new to
rails, so we could easily have missed an important configuration
option in the rails apps, apache or passenger.

Thanks in advance.

examine your error_log (/var/log/httpd/error_log?) and the
production.log. What is the issue? Does it just freeze without a
note in the logs?

Yes. I just asked our sysadmin. The httpd log shows that max_clients
limit is reached. When we first ran into the problem, we raised it to
256, then to 500. We never have more than 2 or 3 using the server at
a time, so it seems something is not closing properly.


I had a similar problem - our log read:

/!\ FAILSAFE /!\  Thu Apr 29 10:55:46 -0400 2010
  Status: 500 Internal Server Error
  Host 'coolhostname.com' is blocked because of many connection

errors; unblock with ‘mysqladmin flush-hosts’

so, that mysqladmin flush-hosts cleared up the problem, but then the
problem happened again and again.

We ended up fixing it for good by setting ‘max_connect_errors’ to 512.

Good luck,

Has anyone else experienced such a problem?

I have. And I did not know the reason why, but running Rails directly
on port 80 not via Passenger/Apache does not have this problem.