Jump to content

stoneyd

Members
  • Posts

    19
  • Joined

  • Last visited

Posts posted by stoneyd

  1. what ?

     

    I meant more like

     

    while (mysql_connect() === false);

     

    But disabling the query log will defiantly help with server load.

     

    i had the query log on just for a short time to see if i could see any problems in it.  but other sites running this same source haven't encountered problems like this.

    I'm trying to figure out why this happens. Where do you think the bottleneck is happening? Also its gonna be impossible to get ahold of the source code to this.

  2. I guess that means it has to be load related then. Which is a bit of a bad conclusion really  :(

     

    You could try the keep trying until you get a connection approach I mentioned, although you would need to get the decrypted versions of those scripts.

     

    Well i guess in theory i could go with general log so it logs every query. but in a matter of 20-60 minutes or so i accrued close to 100k or 1mil lines in that file

  3. Okay, it seems to be that your server is too overloaded to get a connection.

     

    a load average of 5 is pretty high really although it does depend on your hardware.

     

    You might need a server upgrade. Or a dodgy workaround that I had to use for a client once was to keep tying to connect until it worked.

     

    Seriously? Damn physical hardware limitations. I doubt upgrading RAM would help? but I don't think I'm gonna be able to upgrade the proc or anything else. During low times our load average: 0.32, 0.50, 1.41. I'll post tonight what our peak load averages are.

  4. if nothing is going in the logs that means you are not actually getting to the server, so yeah its not a max connection issue.

     

    could you use a test script in the same folder as your site to try the connections

     

    <?php
    
    mysql_connect('localhost', 'user', 'pass');
    
    mysql_connect('127.0.0.1', 'user', 'pass');
    
    ?>

     

    and see if either work ?

     

     

    See it is a intermittent issue. i've got the host set to the the actual ip. the localhost works but the 127.0.0.1 returns

    'Warning: mysql_connect(): Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /var/www/dev/test.php on line 4'

     

    no no, back here...

     

    lol. right i forgot about that. see localhost works because it connects over the unix socket. but 127.0.0.1 wont work because the mysqld isnt listening to that ip its looking for the actual ip of the server. But under high-ish loads when it connects over the actual ip it the issue above.

    Which doesnt really make since.

  5. I don't see what's different, you posted that error before.

     

    so there is not difference between

     

    PHP Warning:  mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (11) in 'some/file/on/my/web/server.php'

     

    and

     

    PHP Warning:  mysql_connect(): Lost connection to MySQL server at 'reading initial communication packet', system error: 110

     

     

  6. Well you probably should listen on all ports, or include 127.0.0.1.  That way you don't add overhead to your nic when the server really only wants to talk to itself over the loopback.  Or as you say, if you don't need this server to talk to any other servers, you should change it to 127.0.0.1.

     

    Well if i could have it bind to something without it blocking others then i'd be happy. but from my understanding localhost blocks everything but local connections and 127.0.0.1 as a synonym for localhost would prolly do the same thing. Can someone confirm this?

  7. what’s the load average like on the server ? I guess it might just not be able to respond to the request some of the time. Effectively a hardware limit on the number of connections.

     

    Although you said there were only 3 connections ? so its not that likely to be that :?

     

    I'm out of things to suggest to be honest  :-\

     

    Well, the average load on the server is usually under 5. tho i think i know why 127.0.0.1 isnt working. the bind in my.cnf is set to my actual ip and not the localhost or 127.0.0.1. I think i set it up like that because from my understanding 127.0.0.1 would have prevented outside connections from a diff server connecting to mysqld. Well since switching to the IP i havent gotten anymore of those errors about cant find mysqld.sock. who knows maybe this fixed it.

  8. if nothing is going in the logs that means you are not actually getting to the server, so yeah its not a max connection issue.

     

    could you use a test script in the same folder as your site to try the connections

     

    <?php
    
    mysql_connect('localhost', 'user', 'pass');
    
    mysql_connect('127.0.0.1', 'user', 'pass');
    
    ?>

     

    and see if either work ?

     

     

    See it is a intermittent issue. i've got the host set to the the actual ip. the localhost works but the 127.0.0.1 returns

    'Warning: mysql_connect(): Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /var/www/dev/test.php on line 4'

  9. mmk well even with just 127.0.0.1 it had issues.

     

    what were those issues ? And was there anything useful in the error logs ? I think they should have the reason that the connection fails in.

     

    You could do it the lazy way and try setting the limit to 100k and see if that helps.

     

    Orignally the max connection was set to about 1000. so i think 10k is pretty high comparatively.

     

    /var/log/mysql.error.log logs only the startup info then nothing.

    syslog doesnt do much for me either.

    php and lighttpd logging doesnt have much

  10. if you are the server admin then you can put the socket back be forcefully reinstalling the mysql-server package.

     

    The socket file is still there. far as i can tell it doesnt go away unless i shutdown the mysql server. So i'm not sure how forcefully reinstall the mysql-server package would help. Could you clarify?

     

    Also 4.41 is both rx and tx. yesterday's average is 5.03Mbit/s

    We have about 25k users and average user daily is just over 3500.

  11. the other sysop was the one who noticed the slow down. i was asleep when it started slowing down. I'll try switching it back. vnstat for today reports avg rate at 4.41mb/s so far. I'll try switching it back.

     

    EDIT: Well I tried switching to 127.0.0.1:3306 but apparently the php file i dont have access to editing (they're encrypted) don't like the new config and it breaks the site. :(

     

     

    define('MYSQL_HOST', 'localhost');

    tried changing to

    define('MYSQL_HOST', '127.0.0.1:3306');

    and it breaks my site

  12. PHP Warning:  mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (11) in 'some/file/on/my/web/server.php'

     

    The file name just changes but I get a ton of these. it seems like the server cant connect to the server at all times.

     

    MySQL Server version: 5.1.49-3

    PHP Version 5.3.3-7+squeeze1

     

    Since most of the files I have troubles with are encrypted I can't really give you a query statement. And I dont think its specific to a query.

    i can cat you anything from my.cnf or php.ini. Not sure what kind of info you need. Is it possible that there is a limit how many connections any unix socket can have?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.