Monitoring beanstalkd

1,263 views
Skip to first unread message

Jaume Sabater

unread,
Mar 12, 2010, 8:00:30 AM3/12/10
to beansta...@googlegroups.com
Hello everyone!

I am setting up the Zabbix monitoring solution at work. Among others,
beanstalkd is something I want to monitor. By executing the following
command I get the attached stats, which I am caching to a file
(example taken from a test server):

echo -e 'stats\r' | socat - tcp4-connect:localhost:11300

I know this is a partly objective, partly subjective question but I
was wondering what I would really be interested in monitoring. I have
created items for the 45 values and I am now deleting the ones I don't
think I need. I think that I should not go beyond knowing/getting:

1. It's alive and working fine.
2. A few counters on "how busy it is at the moment"
3. A few counters on max values reached.

IMHO, things such as version, max job size or max bin size are not
worth it. All the total-* and current-* (or most of) look nice but,
what about the cmd-*?

Any hints? Anyone has done this before, and for a while, and could
provide real life experience?

Finally, what is the first line "OK 821"? Should I use that value for
a "status" metric? (OK/not OK)

Thanks.

--
Jaume Sabater
http://linuxsilo.net/

"Ubi sapientas ibi libertas"

beanstalkd_stats.txt

brandon

unread,
Mar 12, 2010, 12:06:55 PM3/12/10
to beanstalk-talk

On Mar 12, 5:00 am, Jaume Sabater <jsaba...@gmail.com> wrote:
> Hello everyone!
>
> I am setting up the Zabbix monitoring solution at work. Among others,
> beanstalkd is something I want to monitor. By executing the following
> command I get the attached stats, which I am caching to a file
> (example taken from a test server):
>
> echo -e 'stats\r' | socat - tcp4-connect:localhost:11300
>
> I know this is a partly objective, partly subjective question but I
> was wondering what I would really be interested in monitoring. I have
> created items for the 45 values and I am now deleting the ones I don't
> think I need. I think that I should not go beyond knowing/getting:
>
> 1. It's alive and working fine.
> 2. A few counters on "how busy it is at the moment"
> 3. A few counters on max values reached.
>
> IMHO, things such as version, max job size or max bin size are not
> worth it. All the total-* and current-* (or most of) look nice but,
> what about the cmd-*?
>
> Any hints? Anyone has done this before, and for a while, and could
> provide real life experience?

Have a look at Dustin's beanstalk tools at http://github.com/dustin/beanstalk-tools
I use some of these scripts with Nagios and I'm sure they can be
easily integrated with Zabbix.

- Brandon

Keith Rarick

unread,
Mar 12, 2010, 2:57:51 PM3/12/10
to beansta...@googlegroups.com
On Fri, Mar 12, 2010 at 5:00 AM, Jaume Sabater <jsab...@gmail.com> wrote:
> Finally, what is the first line "OK 821"? Should I use that value for
> a "status" metric? (OK/not OK)

"OK" means that the stats command has completed successfully. It is
the only response defined for that command (other than the general
error responses listed at the top of doc/protocol.txt), so it doesn't
really mean anything. Sort of like: "stats please?", "OK, here you
go".

"821" is the number of bytes in the rest of the response, not
including the trailing CR LF.

kr

Ludovic Levesque

unread,
Mar 12, 2010, 4:40:04 PM3/12/10
to beansta...@googlegroups.com
Hi,

for reporting system, we use collectd here (at Fotolia): http://collectd.org/

And for beanstalk, we use a ruby script executed via Exec plugin:
http://collectd.org/wiki/index.php/Plugin:Exec
source of ruby script:
http://github.com/luddic/collectd-scripts/blob/master/beanstalkd.rb

We have now some metrics for each tube

And for monitoring, we use nagios with correct plugin:
http://search.cpan.org/~gbarr/Nagios-Plugin-Beanstalk-0.04/
(can check age of tube, quite useful)

Ludo

> --
> You received this message because you are subscribed to the Google Groups "beanstalk-talk" group.
> To post to this group, send email to beansta...@googlegroups.com.
> To unsubscribe from this group, send email to beanstalk-tal...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/beanstalk-talk?hl=en.
>
>

Ask Bjørn Hansen

unread,
Mar 12, 2010, 9:02:21 PM3/12/10
to beanstalk-talk
We use Graham's Nagios plugin that Ludo linked to and recently we
started pulling per-tube stats into reconnoiter. Having stats of how
big the tube backlog is and how many items are processed per second in
reconnoiter is really useful.

Jaume Sabater

unread,
Mar 16, 2010, 7:53:16 AM3/16/10
to beansta...@googlegroups.com

Thanks all for links, comments and suggestions. I'll try to get
something cooked in the following two weeks and let you know the
results. I am also thinking of installing Munin and use both Zabbix
and Munin (see which one I like the most).

Jaume Sabater

unread,
Apr 7, 2010, 9:34:04 AM4/7/10
to beansta...@googlegroups.com
On Fri, Mar 12, 2010 at 10:40 PM, Ludovic Levesque <lud...@gmail.com> wrote:

> And for monitoring, we use nagios with correct plugin:
> http://search.cpan.org/~gbarr/Nagios-Plugin-Beanstalk-0.04/
> (can check age of tube, quite useful)

I finally found the time to try the Nagios plugin. I read the source
code, installed it and played with it for a while. I see that the only
point of the plugin is to monitor whether a given tube is okay and
provide either its age or the number of active workers (reserved jobs
if I am not mistaken). That is fine by me as I could monitor each of
the 3 tubes I've got.

Also, according to advice received in this thread, I have decided to
monitor only the status of the daemon and the tubes/workers (I may end
up monitoring the Linux processes themselves, which are the actual
workers, but I have not decided yet). I agree that collecting stats
such as "number of processed jobs so far" and similar is not really a
monitoring thing and should be done separately (e.g. through collectd
or similar).

Now my question would be how you would check whether the beanstalkd
process is alive and working well. Shall I use the Perl/Python client?
If so, which would be the most basic "command" to send in order to
just get to know it is up and kicking?

Alternatively, I could use something like "lsof -n -t -i
@127.0.0.1:11300 -sTCP:LISTEN"? Although I am not sure how precise
this check would be (I am thinking of zombie or unresponsive
processes).

Erwan A.

unread,
Apr 18, 2010, 5:24:37 AM4/18/10
to beanstalk-talk

On 16 mar, 13:53, Jaume Sabater <jsaba...@gmail.com> wrote:
>
> Thanks all for links, comments and suggestions. I'll try to get
> something cooked in the following two weeks and let you know the
> results. I am also thinking of installing Munin and use both Zabbix
> and Munin (see which one I like the most).
>

You may be interested in the templates for cacti i have uploaded to
github: http://github.com/earzur/cacti-beanstalkd-templates

Erwan
Reply all
Reply to author
Forward
0 new messages