Main Stories
Slash Boxes

Slash Open Source Project

Slashcode Log In

Log In

[ Create a new account ]

Article Poll

Poll I found this article to be
Very Helpful
Not Helpful
Not Very Helpful
[ Results | Polls ]
Comments:0 | Votes:2

slashd not disconnecting from mysql

posted by Krow on 01:06 PM March 28th, 2003   Printer-friendly   Email story
I've just managed to get slash 2.2.6 installed with mySQL 4.0.12 and apache 1.3.27 on a Debian system (local network.) Things appear to be working except that slash doesn't seem to be disconnecting from mySQL after serving up a page - each page eats a new mySQL thread which remains sleeping until enough threads are created such that I run out of memeory (128M.) Is this normal for slash, unique to mySQL 4.0 or debian, or am I just lucky?
This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login
Loading... please wait.
  • Jamie mentioned some tweaks to the mysql cnf file that helped us with this a great deal. The relavant section of our my.cnf looks (partially) like this now:

    [mysqld] ...
    set-variable = table_cache=512
    set-variable = max_connections=300
    set-variable = interactive_timeout=60
    set-variable = wait_timeout=60

    "How about you interface with my ass? By biting it!" --Bender
    • First a note. According to the MySQL online reference manual [], set-variable is deprecated in 4.0. It says to pass the variables as --variable=value in my.cnf.
      For some reason I've yet to figure out, mysqld doesn't seem to be paying a lot of attention to my.cnf. I've had to modify mysqld_safe to pass the variables through (actually only wait_time out, as a test.)
      I'm beginning to realize that 128MB really isn't enough considering all that I'm doing in this machine. I'll have to bump that up a bit. I probably should upgrade the whole box while I'm at it.
      One last observation. With all due respect to Jamie, this sounds more like a band aide than a fix. If slashd is keeping data base connections open, I would assume it would be for caching and performance purposes. If that's the case, existing open, but sleeping, connections should be reused before openning new ones. Otherwise, connections should be closed, and the resources released, when the page has been rendered. Just my two cents worth.
    • OK, MySQL is now reading the my.cng file and the timeouts are set as above. max_connections was already lower. In addition I reconfigured apache to limit the number of child threads and the number of requests per child thread. Still leaking memory (apache, I believe) but things are getting better.