LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > [Resolved] Problems with large file uploads

Reply
 
Thread Tools Display Modes
  #1  
Old 07-13-2010, 12:24 PM
pythod pythod is offline
Member
 
Join Date: Mar 2007
Posts: 19
Default [Resolved] Problems with large file uploads

I am running a file hosting site. I recently switched over to Litespeed on one of my large storage boxes as Nginx+PHP-FPM wasn't handling file uploads properly, but mainly due to lack of support from nginx. I was hoping that LS wouldn't have the same problem, but unfortunately it does

The problem is, large file upload don't work. Problems happen when I try to upload a 300MB+ file that takes around 12 mins to upload. My PHP app receives the file once the web server okays it, but if my app can't find it/LS didn't pass the uploaded file to my app. However, a 100 MB file takes around 3-4 mins to upload and works out just fine. But, when I upload a 330MB file from a slower connection that takes around 80 mins to complete, LS just doesn't accept it. I mean, I can see LS taking in the full upload, but something unknown just happens when the file upload is complete. Although, I have set the connection timeout to the maximum possible, but it just doesn't work. I'm beginning to believe it could be a system/memory cache issues. Any ideas?

My Litespeed config:
Connection Timeout: 10000
Max Request URL Length (bytes) 8192
Max Request Header Size (bytes) 16380
Max Request Body Size (bytes) 1G
Max Dynamic Response Header Size (bytes) 8K
Max Dynamic Response Body Size (bytes) 2047M

Swap is on /dev/shm (8GB RAM drive) - File uploads are temporarily stored by LS here.

Here's my current setup:
Ubuntu 10.04 server amd64
1 x Intel Xeon E5405
16GB RAM
300 GB SATA 10K RPM
24 x 1 TB SATA
Litespeed Web Server Enterprise v4.0.15
PHP 5.2.11 LS SAPI

Thanks!

Last edited by NiteWave; 07-14-2010 at 01:48 PM..
Reply With Quote
  #2  
Old 07-13-2010, 01:46 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
When upload the 300MB file, have you noticed that LSWS storing the request body in the swap directory? If you do, it means LSWS accepts and receives the request.
You can turn on debug logging and check if LSWS send the request body to PHP successfully or not.
There might be a problem on PHP side when receiving the request body from LSWS. First thing is memory limit, PHP uses a lot of memory handling a large upload. The memory limit should be set high enough, check error log and stderr.log see if there are memory related errors from PHP.
Reply With Quote
  #3  
Old 07-13-2010, 09:16 PM
pythod pythod is offline
Member
 
Join Date: Mar 2007
Posts: 19
Yes, I am able to see the request body while the client is POSTing to the server.

PHP's values are also pretty much the same as pulled out from php.ini:

Directive Local Value Master Value
max_execution_time 7200 7200
max_input_nesting_level 64 64
max_input_time 7200 7200
memory_limit 4000000000 4000000000
post_max_size 2047M 2047M

You'll notice that these values are more than sufficient to allow a 300MB upload and that doesn't take more than 1 hour!

All uploads less than 100-150MB are being posted to PHP just fine, but when upload size is 300MB+ and takes more than 20-30 mins, the request body is not being sent to PHP!

I just checked error.log and there are no memory related errors from PHP. I just enabled stderr Log, so as soon as I have something, I will post it here.

Thanks!
Reply With Quote
  #4  
Old 07-13-2010, 09:50 PM
pythod pythod is offline
Member
 
Join Date: Mar 2007
Posts: 19
I turned stderror logging on, but there's nothing being written to that file.

What I noticed is that a large file can be uploaded as soon as the server is restarted, and then after some time (say hour or two later), if I try to upload the same file, php doesn't receive it!
Reply With Quote
  #5  
Old 07-13-2010, 10:11 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,287
can you try lsws 4.1RC3 and see if any difference?
Reply With Quote
  #6  
Old 07-13-2010, 11:13 PM
pythod pythod is offline
Member
 
Join Date: Mar 2007
Posts: 19
Well, that's difficult because I already have a lot of traffic hitting on this server. Can I try any other config fix?
Reply With Quote
  #7  
Old 07-13-2010, 11:16 PM
pythod pythod is offline
Member
 
Join Date: Mar 2007
Posts: 19
Would you like access to my LS's admin to see if all configs are all right?
Reply With Quote
  #8  
Old 07-13-2010, 11:36 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,287
Quote:
Well, that's difficult because I already have a lot of traffic hitting on this server.
it should be safe -- the 4.0.15 still there. you can switch between 4.1RC3 and 4.0.15 in admin console safely and easily, just by clicking one button.

and with 4.1RC3, the upload progress bar scripts like uber-upload is working as expected. (please refer http://www.litespeedtech.com/support...ead.php?t=4136 for more info)

I can check your lsws settings after you've tested 4.1RC3.
Reply With Quote
  #9  
Old 07-13-2010, 11:52 PM
pythod pythod is offline
Member
 
Join Date: Mar 2007
Posts: 19
I can't find the link to 4.1RC3 or the instructions to install it. Could you please help?
Reply With Quote
  #10  
Old 07-13-2010, 11:59 PM
pythod pythod is offline
Member
 
Join Date: Mar 2007
Posts: 19
Nevermind, I got it: http://www.litespeedtech.com/package...4-linux.tar.gz

I'm going to try to install it now.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:20 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.