Results 1 to 3 of 3

Thread: urgent: mysql connections run out

  1. #1
    kalamake is offline Junior Member
    Join Date
    Jan 2008
    Posts
    2

    Default urgent: mysql connections run out

    We have less than 10 user and mysql has default 100 connections. Some how sugar doesnt close connections so i have to reboot server once a day when no more connections are avaible to mysql server.

    Is there anything that i can do prevent that? I use sugar 5.0 ga

  2. #2
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: urgent: mysql connections run out

    As Sugar 5.0 ga is a Beta version I would take 5.0.0a.
    Never saw that problem there.

  3. #3
    spithost is offline Member
    Join Date
    Jan 2007
    Posts
    7

    Default Re: urgent: mysql connections run out

    Hi there,

    Depending of the MySQL-version sometimes it takes quite long for MySQL-connections to time-out.

    You can override some settings when you can access and/or edit /etc/my.cnf when running on a Linux-system.
    Mine looks like this on my production web-servers:
    ---------8<--------
    # The MySQL server
    [mysqld]
    set-variable = max_connections=800
    set-variable = table_cache=1000
    set-variable = interactive_timeout=1200
    set-variable = wait_timeout=1200
    ---------8<--------
    (I have some more settings but they are not really needed in this case)

    This means so much as that there can be a maximum of 800 connections.
    Propably 100 would suffice with you if you time-out the connections earlier. I suspect some of the connections stay open until that time-out time.
    The table_cache is somewhat dependable on the number of connections and, with me, is heightened to 1000.
    I can't really figure out if this is the right value for 800 connections but it works with me ;-)
    Connections will time out (and will be closed) after 1200 seconds (20 minutes) of inactivity.
    Connections wait for a timeout during the same period (20 minutes).
    The defaults of the last two values are VERY long (several hours) which can be very annoying, resource-hogging and leading to the problems you describe.

    You will have to stop and start MySQL for the new settings to get active.
    I use MySQL 5.0x. I know that the versions OLDER then say 4.1 don't really do anything with those values except the number of connections.

    If you use 4.0 or older you CAN heighten the number of connections and the table_cache.
    Try with 800 and 1000 for example and check out what happens.
    It will take some more memory but it's nicer then the errors....

    Hope this helps....

    Regards,
    Klaus

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 2007-11-13, 02:51 PM
  2. Huge backups -- normal?
    By Liam in forum Help
    Replies: 5
    Last Post: 2007-05-02, 05:36 AM
  3. Replies: 7
    Last Post: 2007-02-14, 03:48 PM
  4. MySQL error/no workflow notifications
    By rlbyrd in forum Help
    Replies: 1
    Last Post: 2006-09-11, 09:14 PM
  5. Replies: 3
    Last Post: 2005-11-28, 08:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •