[web2py] Re: Send Errors To Email

2012-09-28 Thread Michael Toomim
If you want a realtime solution, you can trigger an email on each error. Here's a sketch: 1. Add an error handler to routes.py: routes_onerror = [ ('appname/*', '/appname/default/show_error') ] 2. and in default.py: def show_error():

[web2py] Re: web2py 2.0.2 is out

2012-08-30 Thread Michael Toomim
I just discovered this sweet hidden improvement: db(db.mytable.id1).select() Rows (648) The Rows object now prints out the number of rows in the repr() function! That's so useful! Thanks everyone! --

[web2py] Re: Usage example for 'executesql(...,fields=,columns=) allows parsing of results in Rows'

2012-08-30 Thread Michael Toomim
This is awesome! Thanks for the example! On Thursday, August 30, 2012 1:56:09 PM UTC-7, Anthony wrote: db.define_table('person', Field('name'), Field('email')) db.define_table('dog', Field('name'), Field('owner', 'reference person')) db.executesql([SQL code returning person.name and

[web2py] Re: web2py 2.0.2 is out

2012-08-29 Thread Michael Toomim
Wow, this is cool! But I'm hitting a bug in rewrite_on_error: http://code.google.com/p/web2py/issues/detail?id=964 --

[web2py] Re: web2py 2.0.2 is out

2012-08-29 Thread Michael Toomim
I'm really excited about the new scheduler -X option. What do -E -b -L do? I don't see them in --help or in the widget.py code. On Wednesday, August 29, 2012 10:17:48 PM UTC-7, Michael Toomim wrote: Wow, this is cool! But I'm hitting a bug in rewrite_on_error: http://code.google.com/p

[web2py] Re: A new and easier way to test your apps

2012-08-29 Thread Michael Toomim
Sometimes you write things that are just really exciting. --

Re: [web2py] Re: web2py 2.0 stats

2012-08-29 Thread Michael Toomim
That is true! It makes me think, perhaps it would be worthwhile at some point to pause, take stock of all the features, which ones might be better than which other ones, and write up a set of best practices to put into the book. On Wednesday, August 29, 2012 12:49:29 PM UTC-7, Richard wrote:

[web2py] Re: Changing DB passwords, and database/*.table files

2012-08-29 Thread Michael Toomim
This makes sense to me too! The simple way would break backwards compatibility. But this could be avoided if hash function first checks to see if a schema file exists WITH the password, and returns that, else returns a hash w/o the password. On Tuesday, August 28, 2012 10:17:02 AM UTC-7, Chris

[web2py] Re: web2py 2.0.2 is out

2012-08-29 Thread Michael Toomim
Oh, I see, these are scheduler.py options! -b: sets the heartbeat time -L: sets the logging level -E: sets the max empty runs On Wednesday, August 29, 2012 10:23:29 PM UTC-7, Michael Toomim wrote: What do -E -b -L do? I don't see them in --help or in the widget.py code. --

Re: [web2py] Re: possible scheduler bug

2012-08-06 Thread Michael Toomim
Thanks for the great work on the scheduler niphlod! On Wednesday, August 1, 2012 1:19:48 PM UTC-7, Niphlod wrote: The consideration behind that is that if your function doesn't return anything, you don't need the results. Backward compatibility is quite broken in that sense (but scheduler

Re: [web2py] Re: Broken admin in trunk?

2012-07-10 Thread Michael Toomim
, July 10, 2012 5:04:43 PM UTC-4, Michael Toomim wrote: I just upgraded to the trunk. I'm trying to log into the admin, but there's no password entry box. What's wrong? How can I debug this?

Re: [web2py] Re: Broken admin in trunk?

2012-07-10 Thread Michael Toomim
Ah, so I was wrong, great, thank you! On Jul 10, 2012, at 3:20 PM, Massimo Di Pierro wrote: The normal behavior is, as Dave indicated, that you must be over https or from localhost. The change in trunk is that the condition is false, the login form is not even displayed to prevent you from

[web2py] Re: please help us test web2py

2012-07-09 Thread Michael Toomim
On Friday, July 6, 2012 6:35:43 PM UTC-7, Massimo Di Pierro wrote: 2. Remove Share link from welcome app I think we agreed to remove Share link because it's not used very much. I think we agreed to remove the link to addtoany. Do you really want to remove the share tab at the bottom? I

[web2py] Re: Best practice using scheduler as a task queue?

2012-07-06 Thread Michael Toomim
This is a nice solution, and clever, thanks! The upside (compared to postgres locks, as discussed above) is this works for any database. The downside is it creates a whole new table. On Thursday, July 5, 2012 2:49:36 PM UTC-7, nick name wrote: This might have been solved in this week, but in

[web2py] Re: Best practice using scheduler as a task queue?

2012-06-28 Thread Michael Toomim
On Wednesday, June 27, 2012 5:02:26 PM UTC-7, ptressel wrote: This won't solve your installation / setup issue, but I wonder if it would help with the overrun and timeout problems... Instead of scheduling a periodic task, what about having the task reschedule itself? When it's done with

Re: [web2py] Installing scheduler on linux

2012-06-28 Thread Michael Toomim
Maybe this should go into the docs somewhere. Maybe the scheduler docstring next to the upstart script? Maybe post an issue on google code to update the docs? http://code.google.com/p/web2py/issues/list On Jun 28, 2012, at 5:41 AM, Tyrone wrote: Hi Guys, Although this script works great

Re: [web2py] Re: Best practice using scheduler as a task queue?

2012-06-27 Thread Michael Toomim
I'm totally interested in solutions! It's a big problem I need to solve. The recurring maintenance task does not fix the initialization problem—because now you need to initialize the recurring maintenance task. This results in the same race condition. It does fine with the 40,000 records

Re: [web2py] Re: Best practice using scheduler as a task queue?

2012-06-27 Thread Michael Toomim
The problem with terminating the processes is: • sometimes they don't respond to control-c, and need a kill -9 • or sometimes that doesn't work, maybe the os is messed up • or sometimes the developer might run two instances simultaneously, forgetting that one was already running You're

Re: [web2py] Re: Best practice using scheduler as a task queue?

2012-06-27 Thread Michael Toomim
messed up maybe require you to check the os, python programs can't be omniscient :D - messy developers, no easy fix for that too On Wednesday, June 27, 2012 9:18:06 PM UTC+2, Michael Toomim wrote: The problem with terminating the processes is: • sometimes they don't respond

Re: [web2py] Quoting reserved words in DAL

2012-06-27 Thread Michael Toomim
to be biting a few of us. On Jun 20, 2012, at 1:19 PM, Rene Dohmen wrote: I'm having the same problem: https://groups.google.com/d/msg/web2py/hCsxVaDLfT4/K6UMbG5p5uAJ On Mon, Jun 18, 2012 at 9:30 AM, Michael Toomim too...@gmail.com wrote: I just got bit by the reserved-word problem: https

Re: [web2py] Re: database locking web2py vs. external access...

2012-06-27 Thread Michael Toomim
This is all a great unearthing of the Mystery of Transactions. Thanks for the investigation, Doug. This was difficult for me to learn when I got into web2py as well. Perhaps we could write up all this knowledge somewhere, now that you're figuring it out? Can we have a section on Transactions

Re: [web2py] Re: Best practice using scheduler as a task queue?

2012-06-26 Thread Michael Toomim
All, thank you for the excellent discussion! I should explain why I posted that recommendation. The vision of using the scheduler for background tasks was: Woohoo, this scheduler will *automatically handle locks*—so I don't need to worry about stray background processes running in parallel

Re: [web2py] Re: Best practice using scheduler as a task queue?

2012-06-26 Thread Michael Toomim
('process_bonus_queue') On Tuesday, June 26, 2012 7:57:25 PM UTC-7, Michael Toomim wrote: All, thank you for the excellent discussion! I should explain why I posted that recommendation. The vision of using the scheduler for background tasks was: Woohoo, this scheduler will *automatically handle

[web2py] Re: Best practice using scheduler as a task queue?

2012-06-25 Thread Michael Toomim
in the scheduler. I don't recommend using the scheduler as a task queue to anybody. On Tuesday, June 12, 2012 10:24:15 PM UTC-7, Michael Toomim wrote: Here's a common scenario. I'm looking for the best implementation using the scheduler. I want to support a set of background tasks (task1, task2

[web2py] Re: Best practice using scheduler as a task queue?

2012-06-25 Thread Michael Toomim
Er, let me rephrase: I don't recommend using the scheduler for *infinitely looping background tasks*. On Monday, June 25, 2012 4:54:30 PM UTC-7, Michael Toomim wrote: This scenario is working out worse and worse. Now I'm getting tasks stuck in the 'RUNNING' state... even when there aren't

[web2py] Quoting reserved words in DAL

2012-06-18 Thread Michael Toomim
I just got bit by the reserved-word problem: https://groups.google.com/d/msg/web2py/aSPtD_mGXdM/c7et_2l_54wJ I am trying to port a postgres database to a friend's mysql database, but we are stuck because the DAL does not quote identifiers. This problem has been discussed a fair amount:

[web2py] Re: Best practice using scheduler as a task queue?

2012-06-17 Thread Michael Toomim
Thanks for the response, niphlod! Let me explain: The task can be marked FAILED or EXPIRED if: • The code in the task throws an exception • A run of the task exceeds the timeout • The system clock goes past stop_time And it will just not plain exist if: • You have just set up the code

[web2py] Re: Best practice using scheduler as a task queue?

2012-06-17 Thread Michael Toomim
To respond to your last two points: You're right that models only runs on every request... I figured if my website isn't getting any usage then the tasks don't matter anyway. :P Yes, I think there are design issues here, but I haven't found a better solution. I'm very interested in hearing

[web2py] Best practice using scheduler as a task queue?

2012-06-12 Thread Michael Toomim
Here's a common scenario. I'm looking for the best implementation using the scheduler. I want to support a set of background tasks (task1, task2...), where each task: • processes a queue of items • waits a few seconds It's safe to have task1 and task2 running in parallel, but I cannot have

[web2py] Cron problems

2012-05-22 Thread Michael Toomim
I'm finding multiple problems getting cron to start the scheduler. Here's the cron line: @reboot dummyuser python web2py.py -K utility ...but it does not work without modifying web2py source. First, let's get an easy bug out of the way. The web2py book gives this example for @reboot:

[web2py] Changing the controller on the fly

2012-05-11 Thread Michael Toomim
I need to be able to dispatch to a different controller based on a database lookup. So a user will go to a url (say '/dispatch'), and we'll look up in the database some information on that user, choose a new controller and function, and call that controller and function with its view. I've

[web2py] Re: Changing the controller on the fly

2012-05-11 Thread Michael Toomim
:56 AM UTC-4, simon wrote: You can do: def dispatch(): controller,function = ... load these from the database ... redirect(URL(c=controller, f=function, vars=request.vars, args=request.args)) On Friday, 11 May 2012 10:17:19 UTC+1, Michael Toomim wrote: I need to be able

[web2py] Re: Installing scheduler on linux

2012-05-05 Thread Michael Toomim
a different network interface. On Thursday, May 3, 2012 1:22:25 PM UTC-7, Michael Toomim wrote: Anyone have a recipe to make the scheduler run on boot? I'm using ubuntu. Web2py is run in apache (using the recipe in the book), so I can't just use the cron @reboot line. This is the line that needs

[web2py] Re: Installing scheduler on linux

2012-05-05 Thread Michael Toomim
Also: 1. replace friendbo with the name of your app. 2. To start/stop the scheduler, use sudo start web2py-scheduler sudo stop web2py-scheduler sudo status web2py-scheduler ...etc. On Saturday, May 5, 2012 6:47:33 PM UTC-7, Michael Toomim wrote: Here's a solution I wrote

[web2py] Installing scheduler on linux

2012-05-03 Thread Michael Toomim
Anyone have a recipe to make the scheduler run on boot? I'm using ubuntu. Web2py is run in apache (using the recipe in the book), so I can't just use the cron @reboot line. This is the line that needs to be run when my system boots: python /home/web2py/web2py/web2py.py -K appname It seems

[web2py] Re: Why Bottle and Web2py?

2012-05-03 Thread Michael Toomim
I think the best combination of web2py and bottle would be, as you suggested—importing the web2py DAL into bottle. The DAL is the most important thing that bottle lacks, and the web2py DAL is great to plug into other projects. I use it a lot for that. That said, in my experience, you will

[web2py] Re: Web2py templates for HamlPY

2012-04-18 Thread Michael Toomim
This is cool! how do we use it? On Sunday, January 9, 2011 5:07:28 PM UTC-8, Dane wrote: Hey all, thought you might be interested to know that I just patched a project HamlPy, a library for converting a pythonic haml-like syntax to django templates/html, to work with web2py templates. It

[web2py] Create indices from DAL

2012-02-12 Thread Michael Toomim
Here's an improved way to create indices in the DAL. Works only with postgresql and sqlite. def create_indices(*fields): ''' Creates a set of indices if they do not exist Use like: create_indices(db.posts.created_at, db.users.first_name,

[web2py] Re: Help with OAuth20 facebook infinite redirect

2011-12-22 Thread Michael Toomim
Well, I don't need to debug this anymore. I switched to a different facebook app, and I'm no longer having the problem. On Dec 21, 7:55 pm, Michael Toomim too...@gmail.com wrote: I just upgraded from a modified 1.98.2 to 1.99.4 and now I'm getting an infinite redirect when logging

[web2py] Help with OAuth20 facebook infinite redirect

2011-12-21 Thread Michael Toomim
I just upgraded from a modified 1.98.2 to 1.99.4 and now I'm getting an infinite redirect when logging in with OAuth20 and facebook. I'm having trouble debugging. Can someone help? What happens: User goes to /user/login This calls this code in tools.py: # we need to pass through

[web2py] Can't use custom classes in cache

2011-11-14 Thread Michael Toomim
Hi all, it appears I can't use any of my own classes in the cache: class Blah: pass b = blah() cache.disk('blah', lambda: b) This results in: AttributeError: 'module' object has no attribute 'Blah' I think this is because the things I'm defining (e.g. in models/) isn't

[web2py] Re: Can't use custom classes in cache

2011-11-14 Thread Michael Toomim
So let me tease these problems apart. 1. Some objects are not pickleable. These cannot be cached to disk. 2. If the object's class is not defined in the scope available to gluon/cache.py, then the object cannot be unpickled. Both of these problems can be avoided by using cache.ram. (That's what

[web2py] Status of new VirtualFields design?

2011-09-27 Thread Michael Toomim
What's the status of the new VirtualFields design? The latest I've seen is: db.item.adder=Field.lazy(lambda self:self.item.a + self.item.b) I have two design proposals: (1) Instead of calling them VirtualFields and Lazy VirtualFields, I think they should be VirtualFields and Methods. Two

[web2py] Re: RFC: New design for {{include file.html}} in views

2011-09-10 Thread Michael Toomim
'}} {{selector(id='main-access')}} This is already supported and allows to define more than one function in include. And it is more pythonic. On Sep 9, 10:12 pm, Michael Toomim too...@gmail.com wrote: I frequently write short snippets of HTML that I want to replicate in many places

[web2py] Re: problems changing database field type

2011-09-09 Thread Michael Toomim
I think we need more tools for fixing broken migrations! When I have something broken, sometimes I go into the sql console, edit the database manually, and then use these functions to tell web2py that I've changed the table in sql. (However, I haven't had to use these for at least a year...

[web2py] RFC: New design for {{include file.html}} in views

2011-09-09 Thread Michael Toomim
I frequently write short snippets of HTML that I want to replicate in many places, like: div class=friend_selector div class=access_photos users=[]/div input id=main_access_input name=access_input class=access_input size=30 type=text

[web2py] Re: Lazy virtual fields - strange result!

2011-09-08 Thread Michael Toomim
After some thought, I'm really liking this design for virtual fields... what if lazy/virtual fields were declared directly in db.define_table()? Like so: db.define_table('item', Field('unit_price','double'), Field('quantity','integer'),

[web2py] Re: Lazy virtual fields - strange result!

2011-08-27 Thread Michael Toomim
Interesting approach to use lambdas. Since lambdas don't do side- effects, I checked out my virtualfields to see if my uses have side effects. In my app I have: 12 methods total across 3 database tables 10 of those methods have no side-effects 2 have side-effects The two methods with

[web2py] Re: Lazy virtual fields - strange result!

2011-08-27 Thread Michael Toomim
I'm sorry, that was a doofus comment. Of course lambdas allow side- effects! I wish mailing lists supported delete. On Aug 27, 1:08 pm, Michael Toomim too...@gmail.com wrote: Interesting approach to use lambdas.  Since lambdas don't do side- effects, I checked out my virtualfields to see

[web2py] Re: Virtual Fields. Strange behavior when saving db result sets Build in types

2011-08-14 Thread Michael Toomim
I don't have a direct solution, but FYI I added this info to a bug report on a related topic. http://code.google.com/p/web2py/issues/detail?id=374 Thanks for pointing out the problem. On Aug 14, 8:57 am, Santiago Gilabert santiagogilab...@gmail.com wrote: anyone? I found that someone else

[web2py] Re: Bug in virtualfields w/ session

2011-08-11 Thread Michael Toomim
Ok, it's here http://code.google.com/p/web2py/issues/detail?id=374 Thank you for looking into this Massimo! I do not know the best way to do this... my code is just a first reaction to making something faster. On Aug 11, 2:55 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: This is

[web2py] Here's a helper for db.table.first() and last()

2011-08-11 Thread Michael Toomim
Often I'm at the shell and want to quickly pull up the most recent entry in a table. I wrote a couple of helpers for this. For instance, in a blog app: db.posts.last() ...will get the most recent post. By putting this code at the bottom of db.py, it'll automatically create a first() and

[web2py] Re: RFC about issue

2011-08-11 Thread Michael Toomim
I agree not a big deal: http://www.quora.com/Should-buttons-in-web-apps-be-capitalized On Aug 11, 3:24 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: What do people think? http://code.google.com/p/web2py/issues/detail?id=370 I do not have a strong opinion.

[web2py] Re: Bug in virtualfields w/ session

2011-08-10 Thread Michael Toomim
Ok. The basic idea is to allow you to define helpers methods on rows, sort of like the Models of rails/django. You use it like this... I put this in models/db_methods.py: @extra_db_methods class Users(): def name(self): return '%s %s' % ((self.first_name or ''),

[web2py] Re: Bug in virtualfields w/ session

2011-08-09 Thread Michael Toomim
to rows with only a 10% overhead (instead of 200-300%) and can share that if anyone's interested. On Aug 8, 8:38 pm, Michael Toomim too...@gmail.com wrote: It turns out the speed problem is REALLY bad. I have a table with virtualfields of 14,000 rows. When I run raw sql:     a = db.executesql

[web2py] Re: Bug in virtualfields w/ session

2011-08-08 Thread Michael Toomim
():    print row.b, row.c(1), row.c(2), row.c(3) On Aug 1, 3:10 pm, Michael Toomim too...@gmail.com wrote: Maybe it helps for me to explain my use-case. I mainly use virtual fields as lazy methods, to help traverse related tables. I was actually surprised that lazy evaluation wasn't

[web2py] Re: Bug in virtualfields w/ session

2011-08-08 Thread Michael Toomim
Mid-status note: it would be great if the profiler worked with the web2py shell! Then I could run commands at the command prompt in isolation and see how long they take. On Aug 8, 8:38 pm, Michael Toomim too...@gmail.com wrote: It turns out the speed problem is REALLY bad. I have a table

Re: [web2py] Re: Bug in virtualfields w/ session

2011-08-02 Thread Michael Toomim
) On Aug 1, 3:10 pm, Michael Toomim too...@gmail.com wrote: Maybe it helps for me to explain my use-case. I mainly use virtual fields as lazy methods, to help traverse related tables. I was actually surprised that lazy evaluation wasn't the default. I noticed a few implications

Re: [web2py] Bug in virtualfields w/ session

2011-08-01 Thread Michael Toomim
be pickled, and excluding them if not. Anthony On Mon, Aug 1, 2011 at 5:30 AM, Michael Toomim too...@cs.washington.edu wrote: Awesome! I did not know there was an issue submission system. On Jul 30, 2011, at 7:02 AM, Anthony wrote: An issue has been submitted, and this should

[web2py] Bug in virtualfields w/ session

2011-07-29 Thread Michael Toomim
I think I found a bug in virtualfields. I have the following controller: def posts(): user = session.auth.user n = user.name # returns None Where person is defined as a virtualfield on user: class Users(): def name(self): return self.users.first_name + ' ' +

[web2py] Re: Apache, Wsgi problem

2011-02-10 Thread Michael Toomim
Great!! I also had threads=25 and changed this to threads=1 processes=5, so it makes sense that I was encountering the same problem. It sounds like something in web2py might not be thread-safe. The next time I run a production test I will report if this fixes the problem. On Feb 10, 2:38 pm,

[web2py] Re: Django vs web2py pain points

2011-02-06 Thread Michael Toomim
The biggest django pain points to me: - Templating system is a PAIN. You have to learn a new language, and in the end it's not as powerful as python. - Database ORM can be a pain. Same reasons. You have to learn a big special-purpose API in addition to SQL, and learn how it translates

[web2py] Re: Apache, Wsgi problem

2011-01-19 Thread Michael Toomim
Yes, this echos my experiences exactly! Using apache ab benchmark alone would NOT trigger the error. I had plenty of RAM available. Seems to be a concurrency bug. On Jan 19, 10:53 am, VP vtp2...@gmail.com wrote: What is curious is that RAM is still available, with this error. Monitoring CPU

[web2py] Re: Apache, Wsgi problem

2011-01-17 Thread Michael Toomim
I have pool_size=100, and get the error. On Jan 17, 12:20 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You should really have db = DAL('postgres://name:password@localhost:5432/db',pool_size=20) The reason is that client-server databases may set a max to number of open connections

[web2py] Re: Apache, Wsgi problem

2011-01-17 Thread Michael Toomim
The problem for me is that this occurs on a webapp used by mechanical turk, and it fails when I have hundreds of mechanical turkers using my app... which only happens when I pay them hundreds of dollars. So it's hard to reproduce right now without hundreds of dollars. I am excited to try using

[web2py] Re: Apache, Wsgi problem

2011-01-17 Thread Michael Toomim
1.74.5. I will upgrade when I can reproduce the problem locally. On Jan 17, 5:13 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: How old web2py? We have had bugs in the past that may cause your problem. You should try upgrade. Massimo On Jan 17, 6:58 pm, Michael Toomim too

[web2py] Re: Output of sum(), simplifying the JSON

2011-01-15 Thread Michael Toomim
I find it easiest and cleanest to reformat data structures in python, using list comprehensions. Javascript sucks for loops. So instead of jsonifying the raw database output, fix it first: export_optimizer_records = [{'FreezeTime': r.panel_1hrs.FreezeTime, 'StringID': r.panel_1hrs.StringID,

[web2py] Re: Apache, Wsgi problem

2011-01-10 Thread Michael Toomim
I'm still having this problem too (previous posts linked below). I would love to find a solution. I'm not sure how to debug. VP: Can you provide instructions for reproducing this bug using ab? I had trouble using ab in the past. I am also on a VPS. Since my last post (linked below), I have

[web2py] Re: Apache, Wsgi problem

2011-01-10 Thread Michael Toomim
Thanks, I just investigated this, but it looks like it did not fix the problem. In 8.4.6 Postgres changed the default wal_sync_method to fdatasync, because the old default open_datasync failed on ext4. I use ext3 (on ubuntu 9.10), but I tried changing this option in my postgres database

[web2py] How to create indexes on postgres if not exists

2010-09-17 Thread Michael Toomim
I wanted the equivalent of sqlite's create index if not exists on postgresql. Here's a solution for web2py. It is useful whenever you set up a new database, or migrate new tables to an existing database after a code update and want to ensure the right indexes are set up. def

[web2py] Re: Error in wsgi/apache

2010-07-21 Thread Michael Toomim
Ah, preventing multithreading is a good idea to try too. It wasn't a file descriptor problem either, I had Files used: 1376 out of 75556 On Jul 20, 9:14 pm, Graham Dumpleton graham.dumple...@gmail.com wrote: On Jul 21, 1:41 pm, Michael Toomim too...@gmail.com wrote: I'm using daemon mode

[web2py] Re: Error in wsgi/apache

2010-07-21 Thread Michael Toomim
. -- Thadeus On Tue, Jul 20, 2010 at 4:17 PM, Michael Toomim too...@gmail.com wrote: Thank you for the clarification. My wsgi.conf has default values, so I have not set maximum-requests. Perhaps there are settings there I should look into? I still have free memory, so perhaps

[web2py] Re: Error in wsgi/apache

2010-07-21 Thread Michael Toomim
. -- Thadeus On Tue, Jul 20, 2010 at 4:17 PM, Michael Toomim too...@gmail.com wrote: Thank you for the clarification. My wsgi.conf has default values, so I have not set maximum-requests. Perhaps there are settings there I should look into? I still have free memory, so perhaps

[web2py] Re: Error in wsgi/apache

2010-07-20 Thread Michael Toomim
information will be very useful. Massimo On Jul 19, 9:01 pm, Michael Toomim too...@gmail.com wrote: I'm getting errors like these in my apache error logs: [Mon Jul 19 18:55:20 2010] [error] [client 65.35.93.74] Premature end of script headers: wsgihandler.py, referer:http

[web2py] Re: Error in wsgi/apache

2010-07-20 Thread Michael Toomim
of ubuntu, apache and mod_wsgi that you are using? Any additional information will be very useful. Massimo On Jul 19, 9:01 pm, Michael Toomim too...@gmail.com wrote: I'm getting errors like these in my apache error logs: [Mon Jul 19 18:55:20 2010] [error] [client 65.35.93.74

[web2py] Re: Error in wsgi/apache

2010-07-20 Thread Michael Toomim
 pm, Michael Toomim too...@gmail.com wrote: Let me also summarize the issues so far. Originally:   - I got three types of error messages in apache logs   - Logging messages were often duplicated 2, 3, 5 times   - I got the IOError ticket a few times   - After a while the web

[web2py] Re: Error in wsgi/apache

2010-07-20 Thread Michael Toomim
ways to investigate memory consumption to see where it's being used. On Jul 20, 8:23 pm, Graham Dumpleton graham.dumple...@gmail.com wrote: On Jul 21, 1:03 pm, Michael Toomim too...@gmail.com wrote: THANK YOU ALL SO MUCH for your help! I just learned a LOT.  It looks like resource

[web2py] Error in wsgi/apache

2010-07-19 Thread Michael Toomim
I'm getting errors like these in my apache error logs: [Mon Jul 19 18:55:20 2010] [error] [client 65.35.93.74] Premature end of script headers: wsgihandler.py, referer:

[web2py] Re: Error in wsgi/apache

2010-07-19 Thread Michael Toomim
=1WL68USPJR0HY1ENS50GN6IJ33ZY32hitId=1TK6NH2ZSBU3RCI3F8FK7JE1YXMG96workerId=AJ8R357DF74FFturkSubmitTo=https%3A%2F%2Fwww.mturk.com On Jul 19, 7:01 pm, Michael Toomim too...@gmail.com wrote: I'm getting errors like these in my apache error logs: [Mon Jul 19 18:55:20 2010] [error] [client 65.35.93.74] Premature end

[web2py] Re: Error in wsgi/apache

2010-07-19 Thread Michael Toomim
And after a while apache completely freezes. On Jul 19, 7:05 pm, Michael Toomim too...@gmail.com wrote: This message about bucket brigade is also appearing in the apache error log: [Mon Jul 19 19:01:53 2010] [error] [client 183.87.223.111] (9)Bad file descriptor: mod_wsgi (pid=7940): Unable

[web2py] Re: Error in wsgi/apache

2010-07-19 Thread Michael Toomim
. Is there a way to identify what is causing the Premature end of script errors? On Jul 19, 7:50 pm, Graham Dumpleton graham.dumple...@gmail.com wrote: On Jul 20, 12:01 pm, Michael Toomim too...@gmail.com wrote: I'm getting errors like these in my apache error logs: [Mon Jul 19 18:55:20 2010] [error

[web2py] Best practice for logging w/ wsgi?

2010-04-08 Thread Michael Toomim
Now that I'm on apache, I find that the logging library iceberg wrote no longer works: http://groups.google.com/group/web2py/browse_thread/thread/ae37920ce03ba165/6e5d746f6222f70a I suspect this is because of the stdout/stderr problem with wsgi, but I thought that would only affect print

[web2py] Re: webserver slow, misreported

2010-04-05 Thread Michael Toomim
more flexible and release a 1.1 in the next few days. In the meantime, look into the cron thing. -tim On 4/4/2010 6:44 PM, Michael Toomim wrote: I see, thank you.  I want to measure the web server's response time when I deploy this on turk... Unfortunately the rocket log does

[web2py] Re: webserver slow, misreported

2010-04-05 Thread Michael Toomim
and I'm using postgres not sqlite. On Apr 5, 12:44 pm, Michael Toomim too...@gmail.com wrote: Thanks guys.  Each time I run a test, though, it costs me money because I'm paying people on mechanical turk.  And if it's slow, it gives me a bad reputation.  So I don't want to run more slow tests

[web2py] Re: webserver slow, misreported

2010-04-04 Thread Michael Toomim
I see, thank you. I want to measure the web server's response time when I deploy this on turk... Unfortunately the rocket log does not report time to serve a request. Do you think it is easy to get that information from rocket? Do you store the start and stop times for each request? I see

[web2py] Re: webserver slow, misreported

2010-04-04 Thread Michael Toomim
. On Apr 4, 4:44 pm, Michael Toomim too...@gmail.com wrote: I see, thank you.  I want to measure the web server's response time when I deploy this on turk... Unfortunately the rocket log does not report time to serve a request.  Do you think it is easy to get that information from rocket?  Do you

[web2py] Re: webserver slow, misreported

2010-04-04 Thread Michael Toomim
...@cs.depaul.edu wrote: Some more questions: how much ram? can you check memory usage? A memory leak may cause slowness. are you using cron? when cron starts it may spike memory usage. are you experience the slowness from localhost or from remote machines? On Apr 4, 6:46 pm, Michael Toomim too

[web2py] Re: webserver slow, misreported

2010-03-29 Thread Michael Toomim
I was having slowness problems with cherrypy too! That's why I switched to rocket. So perhaps it's something common to cherrypy and rocket, or perhaps they are both slow in their own ways? This is using web2py from march 16th, so it's not the latest rocket. Do you think something important

[web2py] Re: webserver slow, misreported

2010-03-29 Thread Michael Toomim
. On Mar 29, 12:10 pm, Timothy Farrell tfarr...@swgen.com wrote: On 3/29/2010 1:39 PM, Michael Toomim wrote: I was having slowness problems with cherrypy too!  That's why I switched to rocket.  So perhaps it's something common to cherrypy and rocket, or perhaps they are both slow in their own ways

[web2py] Re: webserver slow, misreported

2010-03-28 Thread Michael Toomim
are very low. Are your models very complex? On 27 Mar, 00:06, Michael Toomim too...@gmail.com wrote: I'm using web2py+rocket to serve jobs on mechanical turk. The server probably gets a hit per second or so by workers on mechanical turk using it. When I have no users, everything is fast

[web2py] webserver slow, misreported

2010-03-26 Thread Michael Toomim
I'm using web2py+rocket to serve jobs on mechanical turk. The server probably gets a hit per second or so by workers on mechanical turk using it. When I have no users, everything is fast. But in active use, I notice that web pages often load reay slow in my web browser, but the httpserver.log

[web2py] Re: webserver slow, misreported

2010-03-26 Thread Michael Toomim
Actually it's handling about 5 requests per second, so there is def some concurrency. On Mar 26, 10:06 pm, Michael Toomim too...@gmail.com wrote: I'm using web2py+rocket to serve jobs on mechanical turk. The server probably gets a hit per second or so by workers on mechanical turk using

[web2py] create index on postgres

2010-03-18 Thread Michael Toomim
I can't create an index on postgresql using executesql. Here's what happens: db.executesql('create index bq_index on bonus_queue (hitid);') ...but the index does not show up in psql. It does not return anything. It seems like the command might be blocking psql, because if I run another index

[web2py] Helper functions to get one from database

2010-03-16 Thread Michael Toomim
Hi guys, I've found the following functions to be commonly useful in practice. Has anyone else written anything similar? Is there a better idiom here, or better names or interfaces for these? def get_one(query): result = db(query).select() assert len(result) = 1, GAH get_one called when

[web2py] Re: no more cherrypy wsgiserver

2010-03-16 Thread Michael Toomim
Did you do anything special to use apachebench on the cherrypy server? When I run ab http://localhost/init/; I get a apr_socket_recv: Connection refused (111) error from apachebench. If I do the same command when running the latest hg tip of web2py (with rocket), the benchmark works. I'm trying

[web2py] Re: no more cherrypy wsgiserver

2010-03-13 Thread Michael Toomim
I'm so excited! I was about to try moving to rocket myself, because I need the scalability and it is very useful for my app to run without apache. THANKS GUYS! On Mar 11, 8:08 am, mdipierro mdipie...@cs.depaul.edu wrote: We moved from cherrypy wsgiserver toRocket, by Timothy Farrell. I

[web2py] How does None and Null work in dal?

2010-03-02 Thread Michael Toomim
How is a database Null entry represented in python when using the DAL? How can you query for null rows? How can you set them? Is this the same as None? And if you create a database row without setting a value for a column, this is set to Null=None, right? Thank you! -- You received this

[web2py] Limiting to a single process

2010-02-18 Thread Michael Toomim
I'm running a background database processing task, and I only want to have ONE task running so I don't have to worry about race conditions. What is the best way to do this? I run this task from a cron @reboot. It runs this script: while True: time.sleep(10) process_queue() I'm worried

[web2py:38429] Migrations broken in hg tip?

2010-01-06 Thread Michael Toomim
I'm using hg tip and can't add a column to a table. It figures out what to do, but doesn't alter the postgresql database. Then any commands that need to use that column fail. It was able to create the table in the first place, but cannot add a column now that the table has been created. How

[web2py:38430] Re: How to do a complex migration?

2010-01-06 Thread Michael Toomim
Here's what I propose: In define_table, at this point: if migrate: sql_locker.acquire() try: t._create(migrate=migrate, fake_migrate=fake_migrate) finally: sql_locker.release() At the end, it can read the database

  1   2   >