Issues with "Connection reset" and mongrels loving memory

Hi folks,
I’ve searched and search, but can’t seem to find solutions that work
for me. I’m hoping if I include enough information I may find some
help here. Here are the problems I am getting reports on:

  1. While using the application, the users are getting intermittent
    “Connection reset by peer” errors in the browser. I’m told it doesn’t
    matter what action they’re performing, just that it is happening more
    and more often. I just turned on my nginx error logs to see if
    anything will show up in there (saw something to this effect in
    another thread somewhere).

  2. I still have problems with the mongrel processes gobbling up memory
    to the point where everything seizes up. It seems to happen about once
    a week, or every other week. I’ve tried so many options that I’ve read
    here and in the mongrel mailing list, but none seem to have worked.
    (I’ve tried the verification_timeout setting, and the
    verify_active_connections thread suggestions). I’m including my mysql
    config below as maybe the problem lies in there.

The server load never gets very high. The only exception is when the
mongrel process get out of control.

My set up:

Ubuntu 7.10
Ruby: 1.8.6
Rails: 1.2.6
MySQL: Ver 14.12 Distrib 5.0.45 (mysql gem: 2.7)
Mongrel: 1.1.1 / mongrel_cluster: 1.0.4
nginx: 0.5.26

  • nginx has 4 worker processes, and for the main app I have 10 mongrel
    servers
  • Every night, the nginx and mongrel processes restart to rotate the
    logs

I may need help with optimizing mysql, here are the config options
from my.cnf:

key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 128K
thread_cache_size = 8
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10

* Query Cache Configuration

query_cache_limit = 1M
query_cache_size = 32M

[isamchk]
key_buffer = 16M

If there’s any other information needed, I’ll gladly provide if asked.

Many thanks.

Bill

First thing, this bugs me, wondering what you firewall setup is.
If your restarting mogrels, and nginx every night, something is
getting “carried” over,
or your getting a DOS attack.

For me, think I would look at half-open connections, and a packet
trace for arround the time the resets are occurring.
Also you may want to check your kernel paramters.
Also sounds like a few different problems your having.