web2py unavailable during file upload cherokee+ssl+uWSGI+web2py

38 views
Skip to first unread message

PhE

unread,
Jan 3, 2011, 6:49:04 PM1/3/11
to web2py-users
Following Massimo's advice on my previous post on file upload with
rocket/ssl, I decided to give another try to cherokee/web2py.

Now I've got reliable ssl file uploads : 4 successful uploads of a 5
MB file (3 to 4 minutes transfer each).
This is a great forward step ;-)

But I still have a big issue : during the transfer the web2py service
is unavailable.
An attempt to access the index page of web2py makes Cherokee to
respond :
503 Service Unavailable
Cherokee web server 1.0.15 (Ubuntu), Port 443

I tried to access the page from a different browser to avoid session
locking with same error.

Note that I use a dummy application with only one table, one upload
field and no code at all ! (I use the really fresh 1.91.6)
Upload is done by admin page https://mysite/myapp/appadmin/insert/db/mytable

I used uWSGI following this recipe : http://web2pyslices.com/main/slices/take_slice/110

mdipierro

unread,
Jan 3, 2011, 7:20:07 PM1/3/11
to web2py-users
Do you use sqlite? That may be locking.


On Jan 3, 5:49 pm, PhE <philippe.entzm...@gmail.com> wrote:
> Following Massimo's advice on my previous post on file upload with
> rocket/ssl, I decided to give another try to cherokee/web2py.
>
> Now I've got reliable ssl file uploads : 4 successful uploads of a 5
> MB file (3 to 4 minutes transfer each).
> This is a great forward step ;-)
>
> But I still have a big issue : during the transfer the web2py service
> is unavailable.
> An attempt to access the index page of web2py makes Cherokee to
> respond :
> 503 Service Unavailable
> Cherokee web server 1.0.15 (Ubuntu), Port 443
>
> I tried to access the page from a different browser to avoid session
> locking with same error.
>
> Note that I use a dummy application with only one table, one upload
> field and no code at all ! (I use the really fresh 1.91.6)
> Upload is done by admin pagehttps://mysite/myapp/appadmin/insert/db/mytable

Roberto De Ioris

unread,
Jan 4, 2011, 3:21:28 AM1/4/11
to web...@googlegroups.com

Il giorno 04/gen/2011, alle ore 00.49, PhE ha scritto:

> Following Massimo's advice on my previous post on file upload with
> rocket/ssl, I decided to give another try to cherokee/web2py.
>
> Now I've got reliable ssl file uploads : 4 successful uploads of a 5
> MB file (3 to 4 minutes transfer each).
> This is a great forward step ;-)
>
> But I still have a big issue : during the transfer the web2py service
> is unavailable.
> An attempt to access the index page of web2py makes Cherokee to
> respond :
> 503 Service Unavailable
> Cherokee web server 1.0.15 (Ubuntu), Port 443


It looks to me that you have no concurrency in your setup.
Cherokee is a streamed-upload server so the uploads is entirely managed by your app.

If you spawn only one uwsgi process this will be be busy during uploads and cannot accept new requests.

Simply add -p <n> to your command line or <processes>n</processes> to your xml config file.

Where n is the number of processes you want to spawn.


--
Roberto De Ioris
http://unbit.it

Philippe ENTZMANN

unread,
Jan 4, 2011, 3:09:32 AM1/4/11
to web...@googlegroups.com
Yes I use sqlite as the default web2py database backend.
The record is created at the end of the transfer, why should have been
a lock during the transfer ?
This "lock" does not occur without Cherokee/uWSGI, why ?

To check this, what is the simplest controller code to achieve an
upload (without database) ?

2011/1/4 mdipierro <mdip...@cs.depaul.edu>:

mdipierro

unread,
Jan 4, 2011, 7:30:02 AM1/4/11
to web2py-users
There are two possibilities.

One was suggested by Roberto.

Another possibility is SQLite. It may block during the transfer if the
upload is done in DB and/or if there is an un-committed transaction.

massimo

On Jan 4, 2:09 am, Philippe ENTZMANN <philippe.entzm...@gmail.com>
wrote:
> Yes I use sqlite as the default web2py database backend.
> The record is created at the end of the transfer, why should have been
> a lock during the transfer ?
> This "lock" does not occur without Cherokee/uWSGI, why ?
>
> To check this, what is the simplest controller code to achieve an
> upload (without database) ?
>
> 2011/1/4 mdipierro <mdipie...@cs.depaul.edu>:

PhE

unread,
Jan 4, 2011, 8:34:30 AM1/4/11
to web2py-users
Thank you !
Fixed ! Now, I can browse while an upload is in progress.

I just added the processes value to my uWSGI conf file :
<uwsgi>
<pythonpath>/var/web2py/</pythonpath>
<processes>4</processes>
<app mountpoint="/">
<script>wsgihandler</script>
</app>
</uwsgi>

mdipierro

unread,
Jan 4, 2011, 9:26:50 AM1/4/11
to web2py-users
Cherokee does not uses thread? 4 processed with 1thread/process seems
limited.
Reply all
Reply to author
Forward
0 new messages