Sunday, March 20, 2011

APC vs pecl uploadprogress

In the Status Report page in drupal, i usually find this message (on fresh installation):

Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the PECL uploadprogress library (preferred) or to install APC.

But i never understood why its preferred the PECL uploadprogress library over APC, and that's my question today.

Is pecl uploadprogress faster, take less system resources, or is more easy to install/configure/use then APC?

Anyone have ideas about why it is preferred over APC? (googlin around for APC vs pecl uploadprogress doesnt return nothin usefull)

From stackoverflow
  • There is an interesting information in the second comment of this blog-post : Upload Progress Meter - Common issues and some answers : (quoting) :

    The main difference is: this extension uses the filesystem as temporary storage, APC uses shared memory. And if you'd like to use another Bytecodecache than APC or do not want to install APC for any reason, this one provides that functionality, too.

    (Both the blog-post and that comment are from Christian Stocker, one of the two authors of the pecl::uploadprogress extension ; so I guess he knows what he's talking about ^^ )

    DaNieL : Ok, but why using the filesystem instead of shared memory is better? Im not a system expert, but this sounds like uploadprogress is slower (doesnt it use a swap-like system?) Or am i totally wrong? (i admit that i dont know exactly what im talking about ;)
    Pascal MARTIN : Considering you have a few GB of RAM (shared memory), and several dozens (if not hundreds) of GB on your disks, I suppose it's "better" to not eat too much RAM with temporary files. OK, RAM might be faster... but considering those files are being uploaded, which means (slow) network connection, the difference in speed between RAM and disk will be negligible, when compared to the time taken to do the upload -- else, you wouldn't need a progress indicator ;-)
    DaNieL : Thanks, really nice explanation!!
    Pascal MARTIN : You're welcome :-)
  • Try to organize your uploads via flash. is the best solution. File will be uploaded by flash, and flash will take care about progress monitoring and it doesn't depend on server side. It also allows to select multiple files in "Browse file" window.

    Pecl module is little hacky. APC gives more stable solution. But in 99% swfupload solves problem better.

    DaNieL : I hate using flash for this silly things that can be easly (and better, imho) done without flash. Flash is needed for other kind of issue, i'll use it for file uploads just when i'll really need the multiple file selection (that i admit is really convenient)


Post a Comment