WordPress.org

Forums

WP-Filebase Download Manager
Open MySQL thread while downloading (6 posts)

  1. rawr34
    Member
    Posted 2 years ago #

    Hello, I was reaching the connection limit on my site and discovered that when downloading a file, wp-filebase open a thread to mysql which doesn't close until the file completes downloading.

    This issue can be duplicated by running SHOW PROCESSLIST; on the MySQL server while a download is occurring.

    This is quite a problem, for if several people are downloading than my site quickly goes offline.

    I tried adding a mysql_close() in the SendFile method before the while loop (line 464), but the thread remained open.

    Please advise.

    http://wordpress.org/extend/plugins/wp-filebase/

  2. Fabian
    Member
    Plugin Author

    Posted 2 years ago #

    Hm, this actually should properly close the connection during download.
    Have you tried to use the link identifier when closing?

    global $wpdb;
    mysql_close($wpdb->dbh);
  3. rawr34
    Member
    Posted 2 years ago #

    Awesome, that works - no threads remain open while downloading (the code was added to line 450 of Download.php).

    Thank you.

  4. Fabian
    Member
    Plugin Author

    Posted 2 years ago #

    Cool, will include this in next release.

  5. rawr34
    Member
    Posted 2 years ago #

    Hello again.

    It seems that, as makes sense, a php thread is also opened and remains open upon downloading a file. This is a problem because each thread is ~30mb, so concurrent downloads quickly consume a large amount of memory.

    Any workarounds/fixes besides redirecting to the actual file and letting the server take care of sending the file? I've done a bit of research and have yet to find if I can let php take care of sending the file without keeping such a large process opened the entire time.

  6. rawr34
    Member
    Posted 2 years ago #

    memory_get_usage() in Download.php reports around 10mb - quite a large amount. If this can be reduced that would at least be a start. I'm attempting to do so by unset()ing some variables, which isn't helping.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-Filebase Download Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.