File upload 503 error after 90 secs

Discussion in 'Ruby/Rails' started by ukmattlaw, Oct 28, 2006.

  1. ukmattlaw

    ukmattlaw Member

    Hi folks,

    I have set up a rails app as per the latest instructions. Everything is fine and very, very fast :)

    However, when I upload a file I get a 503 error after around 90 seconds. I tested the application on a local machine with files up to 8MB and had no problems. I also tried running the same upload on the live machine with webrick and the upload completes even though it takes much longer than 90 seconds.

    Can someone please help me find the problem and fix it? - I am out of ideas :-(

    I am using lsws 2.2.4 standard, if that helps.

    Thanks in advance,

  2. ukmattlaw

    ukmattlaw Member

    I know it's not good form to reply to my own post, but:

    After a 'tail -f' on stderr.log during the upload I get this just before the 503 error is returned:

    [FATAL] failed to allocate memory
    [FATAL] failed to allocate memory
    [FATAL] failed to allocate memory

    Funny thing is that there is a lot of free memory on the machine. The file is being uploaded into a mysql longblob field but since it works OK in webrick on the same machine I doubt that is the issue...
  3. ukmattlaw

    ukmattlaw Member

    File upload 503 error after 90 secs - Solved!

    Setting both "Memory Soft Limit (bytes)" and "Memory Hard Limit (bytes)" in "Server > Security > CGI Resource Control" to 200M seems to have fixed it. I will reduce them to a lower level if possible to make me feel a little more at ease.

    Hopefully this will be useful to someone else.
  4. mistwang

    mistwang LiteSpeed Staff

    Glad you find the solution yourself. :)
  5. ppgengler

    ppgengler Member

    Similiar problem


    I've been having a similar problem and I can get around it for some files by increasing those limits, but eventually I hit a limit again and can't get around it. The solution of changing those doesn't seem very scalable, nor reasonably; for me I have them set to 512MB and it can't upload a 13MB file into a DB blob (Postgre SQL for me). What's the root cause of this and how can it be made to not take so much memory?

  6. mistwang

    mistwang LiteSpeed Staff

    There are memory limits in php.ini as well, you need to increase it along with post size limit.

Share This Page