Skip to content
This repository has been archived by the owner on Sep 20, 2022. It is now read-only.

Commit

Permalink
cache_update_worker追加
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiwara committed Nov 3, 2012
1 parent 0ad272d commit 0a1f7b3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
16 changes: 16 additions & 0 deletions app/perl/update_cache_worker.pl
@@ -0,0 +1,16 @@
#!/usr/bin/env perl

use strict;
use Furl;
use Time::HiRes qw/ sleep /;

my $ua = Furl->new;
while (1) {
my $res = $ua->post("http://127.0.0.1:5000/ticket/update_cache");
if ($res->is_success) {
}
else {
warn $res->status_line;
}
sleep 0.5;
}
12 changes: 10 additions & 2 deletions etc/supervisord/isucon.conf
@@ -1,10 +1,18 @@
[program:isucon_perl]
directory=/home/isucon/app/perl
command=/home/isucon/etc/env.sh perl -Mlib=extlib/lib/perl5 extlib/bin/plackup -s Starman --workers 50 -E production --preload-app app.psgi
command=/home/isucon/etc/env.sh perl -Mlib=extlib/lib/perl5 extlib/bin/plackup -s Starman --workers 100 -E production --preload-app app.psgi
user=isucon
stdout_logfile=/tmp/isucon2.perl.log
stderr_logfile=/tmp/isucon2.perl.log
autostart=false
autostart=true

[program:isucon_perl_worker]
directory=/home/isucon/app/perl
command=/home/isucon/etc/env.sh perl -Mlib=extlib/lib/perl5 update_cache_worker.pl
user=isucon
stdout_logfile=/tmp/isucon2.perl_worker.log
stderr_logfile=/tmp/isucon2.perl_worker.log
autostart=true

[program:isucon_node]
directory=/home/isucon/app/nodejs
Expand Down

0 comments on commit 0a1f7b3

Please sign in to comment.