20 tasks ** .. On Fri, 7 Dec 2018 at 09:50, Tadas U <tadas.ulic...@gmail.com> wrote:
> Sorry, yes, postgres is 9.3 by the way, forgot to mention > > > On Fri, 7 Dec 2018, 09:46 Massimo Di Pierro <massimo.dipie...@gmail.com > wrote: > >> What do you mean by "20 schedulers"? 20 workers? 20 tasks? >> >> On Sunday, 18 November 2018 10:46:35 UTC-8, Tadas U wrote: >>> >>> Web2py version: Version 2.14.6-stable+timestamp.2016.05.10.00.21.47 >>> >>> AFAIK, the scheduler is responsible, e.x.: >>> >>> SETUP (e.x.): >>> >>> scheduler.queue_task( >>> 'test__task_insert', application_name='app', repeats=0, >>> period=60, timeout=3600, retry_failed=-1) >>> >>> def task_insert(): >>> db.table.insert(title='abc') >>> db.commit() >>> # db.close() -- same problem, doesn't matter >>> >>> scheduler = Scheduler(db, { >>> 'test__task_insert': task_insert >>> }) >>> >>> >>> log output, when taks runs: >>> .... >>> 2018-11-13 13:14:11 EET LOG: duration: 0.029 ms statement: BEGIN >>> 2018-11-13 13:14:11 EET LOG: duration: 0.340 ms statement: SELECT >>> scheduler_worker.id, scheduler_worker.worker_name, >>> scheduler_worker.first_heartbeat, scheduler_worker.last_heartbeat, >>> scheduler_worker.status, scheduler_worker.is_ticker, >>> scheduler_worker.group_names, scheduler_worker.worker_stats FROM >>> scheduler_worker WHERE (scheduler_worker.worker_name = 'web2py#8228'); >>> 2018-11-13 13:14:11 EET LOG: duration: 0.305 ms statement: UPDATE >>> scheduler_worker SET status='ACTIVE',last_heartbeat='2018-11-13 >>> 13:14:11',worker_stats='{"status": "RUNNING", "errors": 0, "workers": 1, >>> "queue": 1, "empty_runs": 0, "sleep": 3, "distribution": {"main": >>> {"workers": [{"c": 1, "name": "web2py#8228"}]}}, "total": 1}' WHERE >>> (scheduler_worker.worker_name = 'web2py#8228'); >>> 2018-11-13 13:14:11 EET LOG: duration: 1.890 ms statement: COMMIT >>> 2018-11-13 13:14:11 EET LOG: duration: 0.067 ms statement: BEGIN >>> 2018-11-13 13:14:11 EET LOG: duration: 0.046 ms statement: SET >>> CLIENT_ENCODING TO 'UTF8' >>> 2018-11-13 13:14:11 EET LOG: duration: 0.020 ms statement: SET >>> standard_conforming_strings=on; >>> 2018-11-13 13:14:11 EET LOG: duration: 0.047 ms statement: COMMIT >>> 2018-11-13 13:14:12 EET LOG: duration: 0.029 ms statement: BEGIN >>> 2018-11-13 13:14:12 EET LOG: duration: 2.413 ms statement: INSERT INTO >>> table(title) VALUES ('abc'); >>> 2018-11-13 13:14:12 EET LOG: duration: 2.594 ms statement: COMMIT >>> 2018-11-13 13:14:12 EET LOG: could not receive data from client: >>> Connection reset by peer >>> 2018-11-13 13:14:12 EET LOG: duration: 0.029 ms statement: BEGIN >>> 2018-11-13 13:14:12 EET LOG: duration: 0.285 ms statement: DELETE FROM >>> scheduler_run WHERE (scheduler_run.id = 967703); >>> 2018-11-13 13:14:12 EET LOG: duration: 0.306 ms statement: UPDATE >>> scheduler_task SET status='QUEUED',next_run_time='2018-11-13 >>> 13:15:11',times_run=93796,times_failed=0 WHERE (scheduler_task.id = >>> 371); >>> 2018-11-13 13:14:12 EET LOG: duration: 2.426 ms statement: COMMIT >>> 2018-11-13 13:14:12 EET LOG: duration: 0.024 ms statement: BEGIN >>> .... >>> >>> PROBLEM: "2018-11-13 13:14:12 EET LOG: could not receive data from >>> client: Connection reset by peer" >>> We have ~20 ish active schedulers, so the log gets flooded a lot, >>> basically: >>> >>> 2018-11-13 09:21:00 EET LOG: could not receive data from client: >>> Connection reset by peer >>> 2018-11-13 09:21:00 EET LOG: could not receive data from client: >>> Connection reset by peer >>> 2018-11-13 09:21:00 EET LOG: could not receive data from client: >>> Connection reset by peer >>> 2018-11-13 09:21:16 EET LOG: could not receive data from client: >>> Connection reset by peer >>> 2018-11-13 09:21:46 EET LOG: could not receive data from client: >>> Connection reset by peer >>> 2018-11-13 09:22:00 EET LOG: could not receive data from client: >>> Connection reset by peer >>> 2018-11-13 09:22:00 EET LOG: could not receive data from client: >>> Connection reset by peer >>> 2018-11-13 09:22:01 EET LOG: could not receive data from client: >>> Connection reset by peer >>> >>> -- >> 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. >> > -- 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.