Age | Commit message (Collapse) | Author |
|
daemon.
Key changes:
* Initialization code moved from common.php to StatusNet class;
can now switch configurations during runtime.
* As a consequence, configuration files must now be idempotent...
Be careful with constant, function or class definitions.
* Control structure for daemons/QueueManager/QueueHandler has been refactored;
the run loop is now managed by IoMaster run via scripts/queuedaemon.php
IoManager subclasses are woken to handle socket input or polling, and may
cover multiple sites.
* Plugins can implement notice queue handlers more easily by registering a
QueueHandler class; no more need to add a daemon.
The new QueueDaemon runs from scripts/queuedaemon.php:
* This replaces most of the old *handler.php scripts; they've been refactored
to the bare handler classes.
* Spawns multiple child processes to spread load; defaults to CPU count on
Linux and Mac OS X systems, or override with --threads=N
* When multithreaded, child processes are automatically respawned on failure.
* Threads gracefully shut down and restart when passing a soft memory limit
(defaults to 90% of memory_limit), limiting damage from memory leaks.
* Support for UDP-based monitoring: http://www.gitorious.org/snqmon
Rough control flow diagram:
QueueDaemon -> IoMaster -> IoManager
QueueManager [listen or poll] -> QueueHandler
XmppManager [ping & keepalive]
XmppConfirmManager [poll updates]
Todo:
* Respawning features not currently available running single-threaded.
* When running single-site, configuration changes aren't picked up.
* New sites or config changes affecting queue subscriptions are not yet
handled without a daemon restart.
* SNMP monitoring output to integrate with general tools (nagios, ganglia)
* Convert XMPP confirmation message sends to use stomp queue instead of polling
* Convert xmppdaemon.php to IoManager?
* Convert Twitter status, friends import polling daemons to IoManager
* Clean up some error reporting and failure modes
* May need to adjust queue priorities for best perf in backlog/flood cases
Detailed code history available in my daemon-work branch:
http://www.gitorious.org/~brion/statusnet/brion-fixes/commits/daemon-work
|
|
perf. issue) and confusion if someone tries to change one or the other
|
|
This reverts commit 5ab709b73977131813884558bf56d97172a7aa26.
Missed this one yesterday...
|
|
* doesn't
* won't
* isn't
* don't
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config, otherwise they chew up *lots* of CPU doing nothing
|
|
Another gigantor PEAR coding standards patch. Here, I've moved the
opening curly bracket on a class statement to the following line.
darcs-hash:20081223194923-84dde-77a93de314caadbcb5b70bf346a4648be77a864e.gz
|
|
More PEAR coding standards global changes. Here, I've changed all
instances of TRUE to true and FALSE to false.
darcs-hash:20081223194428-84dde-cb1a1e6f679acd68e864545c4d4dd8752d6a6257.gz
|
|
Another huge change, for PEAR code standards compliance. Function
headers have to be in K&R style (opening brace on its own line),
instead of having the opening brace on the same line as the function
and parameters. So, a little perl magic found all the function
definitions and move the opening brace to the next line (properly
indented... usually).
darcs-hash:20081223193323-84dde-a28e36ecc66672c783c2842d12fc11043c13ab28.gz
|
|
Another global search-and-replace update. Here, I've replaced the PHP
keyword 'NULL' with its lowercase version. This is another PEAR code
standards change.
darcs-hash:20081223192129-84dde-4a0182e0ec16a01ad88745ad3e08f7cb501aee0b.gz
|
|
The PEAR coding standards decree: no tabs, but indent by four spaces.
I've done a global search-and-replace on all tabs, replacing them by
four spaces. This is a huge change, but it will go a long way to
getting us towards phpcs-compliance. And that means better code
readability, and that means more participation.
darcs-hash:20081223191907-84dde-21e8efe210e6d5d54e935a22d0cee5c7bbfc007d.gz
|
|
darcs-hash:20080913164333-84dde-ef4f3363e045aabd52173ea9be34b2f59f64d084.gz
|
|
darcs-hash:20080906015501-84dde-e787962b9805759224389dd42a211dfa21da3473.gz
|
|
darcs-hash:20080904203502-84dde-b95f4c3564a0ccc8dbfec8da7e2ff5b8c57e1ed2.gz
|
|
darcs-hash:20080904194035-84dde-480b3605862d26eff6a2cac6eec02775628287e4.gz
|
|
darcs-hash:20080904193118-84dde-a33d0db712c51177c3f5a5f36483e873aca81532.gz
|
|
darcs-hash:20080904184031-84dde-eba2061f3aa898d0c791ffeb70837f759778c567.gz
|
|
darcs-hash:20080904081542-f6e2c-33b65962d067d142cbdca727625a1b6cc0b30ba4.gz
|
|
darcs-hash:20080902172039-84dde-2b1bbac407959af2a5ca0c764aa503f0cb05c785.gz
|
|
darcs-hash:20080902171740-84dde-ee629f4b5dbcf712cd350c37d0f1814ca1b7f237.gz
|
|
darcs-hash:20080902165735-84dde-e522711214832e6f992b9897aaf8904b1d5c6a2e.gz
|
|
darcs-hash:20080902165319-84dde-b6cc255f014e6c5c059905c37c258a6c7a53b39a.gz
|
|
darcs-hash:20080831003210-84dde-92ccffd5b2e1d50963b18babd93c70fb1d20cdba.gz
|
|
darcs-hash:20080902030910-84dde-01fa58c8c1ab359a077c7a5498973235954be085.gz
|
|
queuehandlers
darcs-hash:20080902012604-84dde-073a583da9b09c80e5e9a47a5eddd144fad8e87a.gz
|
|
darcs-hash:20080831023844-84dde-b8c9ce5f38d33c7fd8a42dc0d3640d500e653011.gz
|
|
darcs-hash:20080831020325-84dde-606d52b08146d4c226f812a9f47b5a3ec1abc743.gz
|
|
darcs-hash:20080830172217-84dde-b5501719421b84ea1ee8346cf8a5ad170fd1db88.gz
|
|
darcs-hash:20080830070135-84dde-dc0cfc8e23c31c33617aa167f7c97d443b10539d.gz
|
|
darcs-hash:20080829182349-84dde-a6d4056d6fa2ecb4c5ed07f3a3a40576315ec4d9.gz
|
|
Eventually, the poor xmppdaemon has become overloaded with extra
tasks. So, I've broken it up. Now, we have 5 background scripts, and
more coming:
* xmppdaemon.php - handles incoming XMPP messages only.
* xmppqueuehandler.php - sends notices from the queue out through XMPP.
* smsqueuehandler.php - sends notices from the queue out over SMS
* ombqueuehandler.php - sends notices from the queue out over OMB
* xmppconfirmhandler.php - sends confirmation requests out over XMPP.
This is in addition to maildaemon.php, which takes incoming messages.
None of these are "true" daemons -- they don't daemonize themselves
automatically. Use nohup or another tool to background them. monit can
also be useful to keep them running.
At some point, these might become fork()'ing daemons, able to handle
more than one notice at a time. For now, I'm just running multiple
instances, hoping they don't interfere.
darcs-hash:20080827205407-84dde-97884a12f5f4e54c93bc785bd280683d1ee7e749.gz
|