fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] dw_dev2013-04-03 04:48 pm
Entry tags:

Worker configuration!

etc/workers.conf now contains a list of all the workers, grouped by functionality, and some basic documentation for the most commonly used ones.

Should make it easier the next time anyone has to test crossposting/importing/notifications, etc.

Feel free to adjust further as required, or if you discover that doing something needs a worker that isn't listed!
alierak: (Default)

[personal profile] alierak 2013-04-03 01:30 pm (UTC)(link)
Nice! I vaguely remember there being some workers that should only have one instance running, that would be a good place to document those if they still exist.
alierak: (Default)

[personal profile] alierak 2013-04-06 02:57 am (UTC)(link)
I think gearman and theschwartz workers might be categorically exempt, since they have well-defined ways to assign a specific task to a worker.

I would look at things like schedule-synsuck and subscribe-hubbub that grab a chunk of rows from some table, iterate over them updating something, and then sleep. If you have more than one running for some reason, they might be working on the same chunk of rows and duplicating tasks.

Some workers of this type (e.g., birthday-notify and expunge-users) use DDLockClient via LJ::locker->trylock() to avoid stepping on each other if running multiple instances. This requires running ddlockd and setting @LJ::LOCK_SERVERS if the instances are on different servers. It might be pointless anyway to run more than one because of the timing of their sleep/work cycles.
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)

[personal profile] afuna 2013-04-06 02:59 am (UTC)(link)
Aha!


Hmm, I've only put the gearman/theschwartz workers in here since that's what workers.conf is for. I think that the other workers will have to be in a separate README or up on the wiki somewhere, in that case.
alierak: (Default)

[personal profile] alierak 2013-04-06 03:01 am (UTC)(link)
http://wiki.dwscoalition.org/wiki/index.php/Workers?

But the ones marked 'Manual' are neither gm nor schwartz and still run from worker-manager.
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)

[personal profile] afuna 2013-04-06 03:07 am (UTC)(link)
!!!

Hmm so I'm guessing all the manual workers always need just the one, yeah?
alierak: (Default)

[personal profile] alierak 2013-04-06 03:24 am (UTC)(link)
Some of them will work with more than one because of the locking mechanism. I could probably come up with a pathological case where you had so many users in so many clusters that needed birthday notifications every day that one worker on one server just wouldn't cut it, but that seems pretty unlikely.
alierak: (Default)

[personal profile] alierak 2013-04-06 02:59 am (UTC)(link)
That said, a worker that doesn't have a good way of handling parallelism could just be considered a bug.
ninetydegrees: Photo: bingo chips (bingo)

[personal profile] ninetydegrees 2013-04-05 10:43 am (UTC)(link)
Is there anything else one needs to do to be able to make the shop work? It won't let me buy anything (I'm talking about step 1: putting something in the cart).
ninetydegrees: Art & Text: heart with aroace colors, "you are loved" (Default)

[personal profile] ninetydegrees 2013-04-05 11:48 am (UTC)(link)
Done, thanks, but it still won't work. Is there anything else?
ninetydegrees: Art & Text: heart with aroace colors, "you are loved" (Default)

[personal profile] ninetydegrees 2013-04-05 12:14 pm (UTC)(link)
Oh I think I figured it out. Thanks a lot for reminding me about the logs!
ninetydegrees: Art & Text: heart with aroace colors, "you are loved" (Default)

[personal profile] ninetydegrees 2013-06-16 07:54 pm (UTC)(link)
For the record, and in case anybody has the same issue, workers never worked for me because I didn't have my TheSchwartz database set up as my hack was too old and I didn't know I should do this. Sophie had me run this:

$LJHOME/bin/ljdb < /usr/share/doc/libtheschwartz-perl/schema.sql

then restart apache and workers. It wouldn't work otherwise.