[web2py] Re: Processing taking a long time in web2py?

2016-11-28 Thread Si
Okay thanks.

I've been looking at profiling my application and I'm running an apache 
webserver. 
Do you know how I would run this? I don't have a local machine.


   1. python web2py.py -F profiler.log

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Processing taking a long time in web2py?

2016-11-23 Thread Niphlod
try to run ti inside a scheduler task

On Wednesday, November 23, 2016 at 1:55:01 PM UTC+1, Si wrote:
>
> Thanks for the reply.
> I understand that they are different things. I was wondering if you could 
> point me in the right direction to somehow be able to speed this up? Or at 
> least find out where the time is being spent. Web2py adding ~20 seconds is 
> quite a lot of time.
> In the future I will be using a library, but for now I have to use this 
> external process.
>
>
> On Sunday, 20 November 2016 20:47:33 UTC, Niphlod wrote:
>>
>> hiding behind auth doesn't get you protected by DDoS. 
>> opening a process inside a web2py app vs pure python depends on you 
>> comparing oranges to apples. web2py env with the default webserver is a 
>> threaded env, your pure python process probably isn't.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Processing taking a long time in web2py?

2016-11-23 Thread Si An
Thanks for the reply.
I understand that they are different things. I was wondering if you could 
point me in the right direction to somehow be able to speed this up? Or at 
least find out where the time is being spent. Web2py adding ~20 seconds is 
quite a lot of time.
In the future I will be using a library, but for now I have to use this 
external process.


On Sunday, 20 November 2016 20:47:33 UTC, Niphlod wrote:
>
> hiding behind auth doesn't get you protected by DDoS. 
> opening a process inside a web2py app vs pure python depends on you 
> comparing oranges to apples. web2py env with the default webserver is a 
> threaded env, your pure python process probably isn't.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Processing taking a long time in web2py?

2016-11-20 Thread Niphlod
hiding behind auth doesn't get you protected by DDoS. 
opening a process inside a web2py app vs pure python depends on you 
comparing oranges to apples. web2py env with the default webserver is a 
threaded env, your pure python process probably isn't.


On Friday, November 18, 2016 at 8:34:46 AM UTC+1, Si An wrote:
>
> I'm asking why opening a process in a python script takes much less time 
> than opening the same python code/process in a web2py application.
>
> Also yes I will consider your second point but I think I will hide it 
> behind authentication
>
> On Thursday, 17 November 2016 22:53:50 UTC, Niphlod wrote:
>>
>> well... you're asking why opening a process in python rather than doing 
>> it directly takes more time. no wonders there: of course it takes more 
>> time! Especially if your process writes lots to stdout/stderr that python 
>> needs to collect.
>>
>> BTW: never ever ever run ANY external process from the webserver: you 
>> could easily be DDoSed AND you incur in lots of issues (random timeouts, 
>> memory issues, leaks, and aforementioned slowness).
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Processing taking a long time in web2py?

2016-11-17 Thread Simon Andersson
I'm asking why opening a process in a python script takes much less time 
than opening the same python code/process in a web2py application.

Also yes I will consider your second point but I think I will hide it 
behind authentication

On Thursday, 17 November 2016 22:53:50 UTC, Niphlod wrote:
>
> well... you're asking why opening a process in python rather than doing it 
> directly takes more time. no wonders there: of course it takes more time! 
> Especially if your process writes lots to stdout/stderr that python needs 
> to collect.
>
> BTW: never ever ever run ANY external process from the webserver: you 
> could easily be DDoSed AND you incur in lots of issues (random timeouts, 
> memory issues, leaks, and aforementioned slowness).
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Processing taking a long time in web2py?

2016-11-17 Thread Niphlod
well... you're asking why opening a process in python rather than doing it 
directly takes more time. no wonders there: of course it takes more time! 
Especially if your process writes lots to stdout/stderr that python needs 
to collect.

BTW: never ever ever run ANY external process from the webserver: you could 
easily be DDoSed AND you incur in lots of issues (random timeouts, memory 
issues, leaks, and aforementioned slowness).

On Thursday, November 17, 2016 at 1:55:28 PM UTC+1, Simon Andersson wrote:
>
> def run():
> import os
> import subprocess
> ex = os.path.join('/home/user', "executable")
>
>
> for i in range(2500):
> a = 1.
> b = 2.
> proc = subprocess.Popen([ex, str(a), str(b),],stdout=subprocess.
> PIPE)
> (out, err) = proc.communicate()
>
>
> redirect(URL('here', args=request.args(0)))
>
> Thanks for the reply. I've written the basic function down. It runs an 
> executable 2500 times.
>
> If I run this in a script it takes 5seconds, and if I run this in web2py 
> it takes 23 seconds.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Processing taking a long time in web2py?

2016-11-17 Thread Simon Andersson
def run():
import os
import subprocess
ex = os.path.join('/home/user', "executable")


for i in range(2500):
a = -5.
b = 50.0
proc = subprocess.Popen([ex, str(a), str(b),],stdout=subprocess.PIPE
)
(out, err) = proc.communicate()


redirect(URL('here', args=request.args(0)))

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Processing taking a long time in web2py?

2016-11-17 Thread mfarees . knysys
It would be easier to understand and solve your problem if you share the 
code.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.