Re: [Cppcms-users] Uploads to slow storage devices
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-04-11 17:54:33
|
> > I recently experienced some problems when uploading (large) files (>=30 > MB) with cherokee to a cppcms based backend application: After a part of > the upload has completed, a 500 Internal Server error is issued to the > browser and the connection (and upload) is terminated. These problems > only occur on an embedded board with a Cortex A8-ARM processor and a > very slow NAND memory (where the file shall be stored to). For file > corruption prevention, the file system (ext3) on this NAND is mounted in > sync mode so that no data is buffered in RAM but anything is written > directly to NAND. Even if async mode is used instead, the error occurs > after some more time (probably if the kernel's I/O buffer is full). > cherokee delivers the upload to the backend application via FastCGI. > My question is: Is there anything within the FastCGI/upload handling in > cppcms that may cause such a behaviour, if e.g. the backend application > needs to long to handle the request (because the file has to be stored > to NAND before the request is handled), or is it all the fault of the > webserver? What version of CppCMS do you use? I assume latest. I'd recommend you to run cppcms process with strace and see what exactly happens when you write to file, i.e. what system call fails: you get the error from the file system (i.e. write(2) failes) or the connection is closed by the cherokee. Also I'd recommend to see if there is anything in the log. Generally there is no timeouts on FastCGI so I don't see were the problem can come from. Also make sure the the files are uploaded to correct location so you have enough space. http://cppcms.com/wikipp/en/page/cppcms_1x_config#security.uploads_path > As a sidenote I may add that we successfully use the very same backend > application on several other systems with different architectures, but > faster storage devices and even on the very same board using SD cards > instead of onboard NAND. > As far as I know, the cherokee webserver passes uploaded files directly > to FastCGI applications (while other webservers like lighttpd or nginx > buffer the whole or at least part of the upload file before they deliver > it to the FastCGI application). > > Thanks for your help, > Julian Best Regards, Artyom Beilis |