Best way to do background calculations?

Israel Brewster israel at ravnalaska.net
Mon Oct 26 12:58:07 EDT 2015


On Oct 25, 2015, at 3:40 PM, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
> 
> On Fri, 23 Oct 2015 08:35:06 -0800, Israel Brewster <israel at ravnalaska.net>
> declaimed the following:
> 
>> tl;dr: I've been using the multiprocessing module to run some calculations in the background of my CherryPy web app, but apparently this process sometimes gets stuck, causing problems with open sockets piling up and blocking the app. Is there a better way?
>> 
>> The (rather wordy) details:
>> 
> 	The less wordy first impression...
> 
>> I have a moderately busy web app written in python using the CherryPy framework (CherryPy v 3.8.0 with ws4py v 0.3.4 and Python 2.7.6) . One of the primary purposes of this web app is to track user-entered flight logs, and keep a running tally of hours/cycles/landings for each aircraft. To that end, whenever a user enters or modifies a log, I "recalculate" the totals for that aircraft, and update all records with the new totals. There are probably ways to optimize this process, but so far I haven't seen a need to spend the time.
>> 
> 	Off-hand -- this sounds like something that should be in a database...
> Unless your calculations are really nasty, rather than just aggregates, a
> database engine should be able to apply them in SQL queries or stored
> procedures.

Sounds like a potentially valid approach. Would require some significant re-tooling, but could work. I'll look into it.

-----------------------------------------------
Israel Brewster
Systems Analyst II
Ravn Alaska
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7293
-----------------------------------------------


> -- 
> 	Wulfraed                 Dennis Lee Bieber         AF6VN
>    wlfraed at ix.netcom.com    HTTP://wlfraed.home.netcom.com/
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list