Re: [web2py] Re: Server slow

2010-12-26 Thread Kenneth Lundström
So it rather fast not slow :=) But the edited_by column is not showing a name, it shows a number. But that is not very intresting as I don´t need a list like that, it was just a test. I´m trying to optimize some reporting functions. I´ll have to start from an other angle. Kenneth Now I u

[web2py] Re: Server slow

2010-12-26 Thread mdipierro
Now I understand. The problem is here: Field('edited_by', db[user_table], required=True), When you do {{=orders}} is uses a default representation for edited_by. The field contains a user id and the default representation is the user name. So for each record it has to do a database lookup (980

Re: [web2py] Re: Server slow

2010-12-26 Thread Kenneth Lundström
What part of the model would you like to see? This? db.define_table('orders', db.Field('name', 'string', length=40, requires=IS_NOT_EMPTY()), db.Field('district', db.district, required=True), db.Field('edited_by', db[user_table], required=True), db.Field('edited_date', 'datetime'

[web2py] Re: Server slow

2010-12-25 Thread mdipierro
I have never seen this before. Can I see the model? massimo On Dec 25, 3:51 pm, Kenneth Lundström wrote: > >  Is this reproducible? > > This happens all the time, if I do it ten times in a row every time it takes > 38-39 seconds. Even with lynx on the server itself it takes about 40 seconds. >

Re: [web2py] Re: Server slow

2010-12-25 Thread Kenneth Lundström
Is this reproducible? This happens all the time, if I do it ten times in a row every time it takes 38-39 seconds. Even with lynx on the server itself it takes about 40 seconds. If I use: t0=time.time() orders = db(db.orders.id> 0).select() logging.info('time to fetch %s' % (time.

[web2py] Re: Server slow

2010-12-25 Thread mdipierro
Is this reproducible? If so, instead of timing t0=time.time() orders = db(db.orders.id > 0).select() logging.info('time to fetch %s' % (time.time()-t0)) try time sql = db(db.orders.id > 0)._select() t0=time.time() db.executesql(sql) logging.info('time to fetch %s' % (

Re: [web2py] Re: Server slow

2010-12-25 Thread Kenneth Lundström
980 rows, 10 columns of data, 38 sec. MySQL server is on the same server, Apache server is not local, but the delay is allways 38-39 seconds. Kenneth No idea. How much data. What db? is it local? Probably something is wrong anyway. On Dec 24, 5:55 pm, Kenneth Lundström wrote: I finally ha

[web2py] Re: Server slow

2010-12-24 Thread mdipierro
No idea. How much data. What db? is it local? Probably something is wrong anyway. On Dec 24, 5:55 pm, Kenneth Lundström wrote: > I finally had time to find out a little about loggin.conf. > > In my logs/web2py.log I get this line: > 2010-12-25 01:42:30,097 - root - INFO - time to fetch 1.81220602

Re: [web2py] Re: Server slow

2010-12-24 Thread Kenneth Lundström
I finally had time to find out a little about loggin.conf. In my logs/web2py.log I get this line: 2010-12-25 01:42:30,097 - root - INFO - time to fetch 1.81220602989 So it takes under 2 seconds to fetch the data and the rest 37 to show it? How come? Kenneth Were is this logged, I could not

Re: [web2py] Re: Server slow

2010-12-03 Thread Kenneth Lundström
Were is this logged, I could not find anything in any logs? Kenneth try import time, logging def testing(): t0=time.time() orders = db(db.orders.id> 0).select() logging.info('time to fetch %s' % (time.time()-t0)) return orders so you can isolate the problem and see if i

[web2py] Re: Server slow

2010-12-02 Thread mdipierro
try import time, logging def testing(): t0=time.time() orders = db(db.orders.id > 0).select() logging.info('time to fetch %s' % (time.time()-t0)) return orders so you can isolate the problem and see if it is in fetching or somewhere else (for example session locking). On Dec 2,

Re: [web2py] Re: Server slow

2010-12-02 Thread Kenneth Lundström
> When you test is that the only active connection to the db? I tested it on an application running on the test instance. There could have been lite activity one production site. But when I tested loading the same function five times in about 10 minutes I allways 39 seconds to load the data.

Re: [web2py] Re: Server slow

2010-12-02 Thread Michele Comitini
Kenneth, When you test is that the only active connection to the db? 2010/12/2 Kenneth Lundström : >> Please tell us more about the setup. Are the three instances behind >> running on the same server? > > Yes. > >> why three? What do they do? > > One is production, one is testing and last one is

Re: [web2py] Re: Server slow

2010-12-02 Thread Kenneth Lundström
> Please tell us more about the setup. Are the three instances behind running on the same server? Yes. > why three? What do they do? One is production, one is testing and last one is development. I had two instances running on a virtual server before and it worked fine. > This is not normal

[web2py] Re: Server slow

2010-12-02 Thread mdipierro
Please tell us more about the setup. Are the three instances behind running on the same server? why three? What do they do? This is not normal but I suspect the problem is with database. Did you set DAL(...,pool_size=10)? On Dec 2, 5:13 am, Kenneth Lundström wrote: > Hello list, > > need some

[web2py] Re: Server slow

2010-12-02 Thread Kenneth Lundström
Of course I forgot something, python 2.6.5 Kenneth Hello list, need some help finding out why my server is so slow. The server is with a Intel Celeron 2.66 GHz CPU, 4 GB of memory CentOS 5.5 64-bit, Apache 2.2.3, MySQL 5.0.77, mod_wsgi, Web2py 1.89.5 The server is dedicated to web2py, there