[web2py] Re: Page with four LOAD components is too slow

2017-07-21 Thread Leonel Câmara
What I mean is that nowadays it's not that expensive to have a 256GB server with 20 cores. So instead of having a load balancer, a lot of machines running web and application servers, a lot of other machines running databases, etc. You can start with a small server and keep improving it for

[web2py] Re: Page with four LOAD components is too slow

2017-07-21 Thread 黄祥
@leonel, might i know what do you mean with scaling horizontally and scaling vertically? thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Re: Page with four LOAD components is too slow

2017-07-21 Thread Leonel Câmara
I'm using a 32GB quad core server, which is way **way** more than I need at the moment, but soyoustart is ridiculously cheap and I have this stupid idea that before scaling horizontally you scale vertically as much as possible. -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Page with four LOAD components is too slow

2017-07-21 Thread Bernardo Leon
It seems that you are right, I set up a virtual machine with 4gb ram only for the database and I ran the code along with redis on my laptop with 16gb ram and my times now are nearly the 600ms. I think it is good enough. Having some components that don't perform selects rendering only a simple

[web2py] Re: Page with four LOAD components is too slow

2017-07-21 Thread Leonel Câmara
Yes I'm pretty sure it's a RAM issue, 48 free MB is way too low. You easily start having to use virtual memory with a couple of requests. To give you an idea, on a similar setup but a much better machine, I have a much much more complex page than yours appears to be, with quite a lot of

[web2py] Re: Page with four LOAD components is too slow

2017-07-20 Thread Bernardo Leon
Yes, the application, redis and the database are in the same server. This server has 512 MB of RAM but I don't think I am using all the ram. I have 48mb free right now. Regarding the code, it just makes simple selects on one or two tables (the querys arent doing anything weird). Do you still

[web2py] Re: Page with four LOAD components is too slow

2017-07-20 Thread Leonel Câmara
That still seems slow actually. Is redis on that same machine or could you have latency issues there too? If it is then it's hard to tell what's causing the slowness now that everything is in the same machine. We would need to know the machine specs and what your code is doing exactly. You may

[web2py] Re: Page with four LOAD components is too slow

2017-07-20 Thread Bernardo Leon
Thank you to both of you. Anthony I was using redis to handle my sessions hence I can discard that bottleneck besides I need the session info on my components. It seems that web2py performs more querys to the database than expected. I have the database on digitalocean but was using web2py on

[web2py] Re: Page with four LOAD components is too slow

2017-07-19 Thread Leonel Câmara
You are probably doing too much stuff. See if you can pre-compute stuff. For instance. Imagine you have a debate table, then you have a comment table that refers to the debate where the comment is made. If you want to show a list of debates with the comment count, then you will have to make