• Resolved willmultipress

    (@willmultipress)


    Hi,
    I always get this error when I try and Broadcast: Error establishing a database connection.
    I am broadcasting a simple post to 260 sites.
    It kills the mysql server.

    Any advice please?
    Thanks

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter willmultipress

    (@willmultipress)

    .

    Plugin Author edward_plainview

    (@edward_plainview)

    The lost DB connection is new, but I’m thinking it’s very related to the large amount of sites you are trying to broadcast to. Even if each site takes 1 second, that’s 260 seconds of broadcast time. Plenty of time for PHP to time out.

    See the Broadcast FAQ: Timeout problems.

    That contains a few solutions to your problem.

    Thread Starter willmultipress

    (@willmultipress)

    I have the ‘Queue add-on’ installed.
    Any help on the ini file please:

    ; cPanel-generated php ini directives, do not edit
    ; Manual editing of this file may result in unexpected behavior.
    ; To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
    ; For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)

    max_input_vars = 6000
    max_input_time = 5000
    memory_limit = 6000M
    max_execution_time = 5000
    zend_extension=/usr/local/php53/lib/php/extensions/ioncube.so
    zend_extension=/usr/local/php53/lib/php/extensions/ZendOptimizer.so
    allow_url_fopen = Off
    allow_url_include = Off
    asp_tags = Off
    display_errors = Off
    enable_dl = Off
    file_uploads = On
    session.gc_maxlifetime = 1440
    session.save_path = “/var/cpanel/php/sessions/ea-php56”
    upload_max_filesize = 1024M
    post_max_size = 50000M

    Thanks
    Will

    Thread Starter willmultipress

    (@willmultipress)

    .

    Plugin Author edward_plainview

    (@edward_plainview)

    Keep your max execution time to a normal 30s.

    Most web hosts will usually have a hard timeout of 30-60 seconds, so anything higher than that will abort abruptly anyways.

    Thread Starter willmultipress

    (@willmultipress)

    OK.
    So any other suggestions please?
    How many sites was is built for?
    Thanks

    Plugin Author edward_plainview

    (@edward_plainview)

    Suggestions to not losing the database connection? Not really… I can’t say much since I have no idea what kind of web host you have.

    I have users that have over 4000 sites. The queue is usually left overnight since it takes several hours to write a new post with images and what not.

    Thread Starter willmultipress

    (@willmultipress)

    I have added the Group add on and will spit the 250 site into groups of 50 and hopefully that will help.

    Plugin Author edward_plainview

    (@edward_plainview)

    That shouldn’t be necessary.

    My uneducated guess is that the queue is trying to broadcast to too many sites at once, due to very high PHP timeout limits that aren’t real.

    Set your timeout to a normal low value of 30 and then let the queue due its job. You can, in order to find out how long a single broadcast takes, do the following:

    – Disable the queue
    – Enable Broadcast debug to file mode
    – Broadcast the post to just one site
    – Check the debug file to see how long the broadcast takes

    That should show you how long each site takes.

    Thread Starter willmultipress

    (@willmultipress)

    So, I split the list into 50s, updated the 1st and 2nd group and it worked perfectly. (published to 100 sites)
    It crashed on the 3rd 50.
    Can I check when its really done and I don’t think refreshing the Queue page and seeing nothing means its really done.
    I expect if I were to leave it 5 minutes between each push, it would work.

    The timeout is default 60.

    Ta

    Plugin Author edward_plainview

    (@edward_plainview)

    I wouldn’t be satisfied with having to wait.

    One last thing I would check is whether the web host has any anti-DDOS functionality that is preventing the database from being contacted “too often”. That’s what I would guess is the problem considering that waiting seems to work better for you.

    There are some webhosts that are paranoid enough to limit DB connections. :/

    Thread Starter willmultipress

    (@willmultipress)

    Thanks, I have asked.

    Thread Starter willmultipress

    (@willmultipress)

    Still not worked.

    Plugin Author edward_plainview

    (@edward_plainview)

    Your webhost didn’t say anything about ddos protection or an overworked SQL server? Are you on a shared server?

    Have you tried on another server?

    If you can’t get it running properly, would it help if I logged in and took a look? If so, e-mail me at [email protected].

    Thread Starter willmultipress

    (@willmultipress)

    Thanks, the web-host does not have a DDOS system.
    I fixed the problem by throwing money at it, I doubled the RAM from 16 to 32.
    This worked, I can publish to all 260 without problems.
    Thanks.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Error establishing a database connection when braodcasting – always’ is closed to new replies.