librelist archives

« back to archive

guruplug (sheevaplug, plugcomputer...) what is the best way to deploy a flask server?

guruplug (sheevaplug, plugcomputer...) what is the best way to deploy a flask server?

From:
Julio Briso-Montiano
Date:
2012-08-24 @ 08:27
Hello,

I'd like to deploy a flask web in a guruplug with only 500Mb RAM (
http://www.globalscaletechnologies.com/p-49-guruplug-server-standard.aspx).

The OS is Debian 6


In testing mode now i'm launching the application in this way:

$ nohup python flaskrdebian.py>lanzaflask.log</dev/null &

Running on http://localhost:5000/


i think this is not the best way to deploy my web and perhaps it takes
too much memory
which is the best method to deploy flask-web-server in this machine?




Thank you

Re: [flask] guruplug (sheevaplug, plugcomputer...) what is the best way to deploy a flask server?

From:
Iwan Budi Kusnanto
Date:
2012-08-26 @ 00:44
On Fri, Aug 24, 2012 at 3:27 PM, Julio Briso-Montiano
<juliobrisomontiano@gmail.com> wrote:
> Hello,
>
> I'd like to deploy a flask web in a guruplug with only 500Mb RAM
> (http://www.globalscaletechnologies.com/p-49-guruplug-server-standard.aspx).

I think 500 MByte is quite big amount of RAM for simple web apps,
except you installed gnome/kde on it.
In my case, i deploy flask in a plug with 512MB of RAM using supervisord.

>
> The OS is Debian 6
>
>
> In testing mode now i'm launching the application in this way:
>
> $ nohup python flaskrdebian.py>lanzaflask.log</dev/null &
>
> Running on http://localhost:5000/
>
>
>
>
> i think this is not the best way to deploy my web and perhaps it takes too
> much memory
> which is the best method to deploy flask-web-server in this machine?
>
>
>
>
>
>
> Thank you



-- 
Iwan Budi Kusnanto

Re: [flask] guruplug (sheevaplug, plugcomputer...) what is the best way to deploy a flask server?

From:
Smartboy
Date:
2012-08-24 @ 14:55
I used flask on my Sheevaplug before, and I never had problems with memory
issues. The only way around this is probably to create a pretty big swap
file.

On Fri, Aug 24, 2012 at 1:27 AM, Julio Briso-Montiano <
juliobrisomontiano@gmail.com> wrote:

> Hello,
>
> I'd like to deploy a flask web in a guruplug with only 500Mb RAM (
> http://www.globalscaletechnologies.com/p-49-guruplug-server-standard.aspx
> ).
>
> The OS is Debian 6
>
>
> In testing mode now i'm launching the application in this way:
>
> $ nohup python flaskrdebian.py>lanzaflask.log</dev/null &
>
> Running on http://localhost:5000/
>
>
>
> i think this is not the best way to deploy my web and perhaps it takes 
too much memory
> which is the best method to deploy flask-web-server in this machine?
>
>
>
>
>
> Thank you
>
>

Re: [flask] guruplug (sheevaplug, plugcomputer...) what is the best way to deploy a flask server?

From:
Anthony Ford
Date:
2012-08-24 @ 15:54
Wouldn't it be more efficient running your flask instance behind
something like Gunicorn and nginx or lighthttpd than via the testing
WSGI server?

Anthony Ford,
KF5IBN,
Research Assistant,
Center for Advanced Radio Astronomy,
University of Texas at Brownsville
ford.anthonyj@gmail.com


On Fri, Aug 24, 2012 at 10:55 AM, Smartboy <smartboyathome@gmail.com> wrote:
> I used flask on my Sheevaplug before, and I never had problems with memory
> issues. The only way around this is probably to create a pretty big swap
> file.
>
>
> On Fri, Aug 24, 2012 at 1:27 AM, Julio Briso-Montiano
> <juliobrisomontiano@gmail.com> wrote:
>>
>> Hello,
>>
>> I'd like to deploy a flask web in a guruplug with only 500Mb RAM
>> (http://www.globalscaletechnologies.com/p-49-guruplug-server-standard.aspx).
>>
>> The OS is Debian 6
>>
>>
>> In testing mode now i'm launching the application in this way:
>>
>> $ nohup python flaskrdebian.py>lanzaflask.log</dev/null &
>>
>> Running on http://localhost:5000/
>>
>>
>>
>>
>>
>> i think this is not the best way to deploy my web and perhaps it takes too
>> much memory
>> which is the best method to deploy flask-web-server in this machine?
>>
>>
>>
>>
>>
>>
>>
>> Thank you
>
>

Re: [flask] guruplug (sheevaplug, plugcomputer...) what is the best way to deploy a flask server?

From:
juliobrisomontiano
Date:
2012-08-26 @ 16:56
Thanks to all.
Finally i deployed my personal web with lighttpd. It took me all the 
weekend because two problems:

http://flask.pocoo.org/docs/deploying/fastcgi/

- i had to put in comments all lines refering to 'static' (minor problem)

fastcgi.server = ("/yourapplication.fcgi" =>
     ((
         "socket" => "/tmp/yourapplication-fcgi.sock",
         "bin-path" => "/var/www/yourapplication/yourapplication.fcgi",
         "check-local" => "disable",
         "max-procs" => 1
     ))
)

/#alias.url = (
#    "/static/" => "/path/to/your/static"
#)/

url.rewrite-once = (
/#    "^(/static.*)$" => "$1",/
     "^(/.*)$" => "/yourapplication.fcgi$1"

- And the most important. I had to change all .html in my templates 
folder. I had to change the lines containing /{{ for_url('function') }} 
/ by the function that calls in the python file for flask, otherwise it 
adds me a '/'
........ and then redirect to /yourapplication.fcgi/function ---> error 404

But finally i get it, and it works quickly with a little bit of RAM.

Thanks


El 24/08/12 17:54, Anthony Ford escribió:
> Wouldn't it be more efficient running your flask instance behind
> something like Gunicorn and nginx or lighthttpd than via the testing
> WSGI server?
>
> Anthony Ford,
> KF5IBN,
> Research Assistant,
> Center for Advanced Radio Astronomy,
> University of Texas at Brownsville
> ford.anthonyj@gmail.com
>
>
> On Fri, Aug 24, 2012 at 10:55 AM, Smartboy <smartboyathome@gmail.com> wrote:
>> I used flask on my Sheevaplug before, and I never had problems with memory
>> issues. The only way around this is probably to create a pretty big swap
>> file.
>>
>>
>> On Fri, Aug 24, 2012 at 1:27 AM, Julio Briso-Montiano
>> <juliobrisomontiano@gmail.com> wrote:
>>> Hello,
>>>
>>> I'd like to deploy a flask web in a guruplug with only 500Mb RAM
>>> (http://www.globalscaletechnologies.com/p-49-guruplug-server-standard.aspx).
>>>
>>> The OS is Debian 6
>>>
>>>
>>> In testing mode now i'm launching the application in this way:
>>>
>>> $ nohup python flaskrdebian.py>lanzaflask.log</dev/null &
>>>
>>> Running on http://localhost:5000/
>>>
>>>
>>>
>>>
>>>
>>> i think this is not the best way to deploy my web and perhaps it takes too
>>> much memory
>>> which is the best method to deploy flask-web-server in this machine?
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Thank you
>>