forked from tony2001/pinba_engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 021330c
Showing
23 changed files
with
9,335 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
_configs.sed | ||
Makefile | ||
Makefile.in | ||
config.guess | ||
config.sub | ||
acconfig.h | ||
aclocal.m4 | ||
autom4te.cache | ||
config.cache | ||
config.log | ||
config.status | ||
configure | ||
conftest | ||
conftest.c | ||
generated_lists | ||
meta_cc | ||
meta_ccld | ||
mkinstalldirs | ||
missing | ||
install-sh | ||
libtool | ||
shlibtool | ||
*.lo | ||
*.la | ||
libs | ||
.deps | ||
.libs | ||
_libs | ||
include | ||
confdefs.h | ||
*.gcda | ||
*.gcno | ||
cscope.out | ||
ltmain.sh | ||
depcomp | ||
config.h | ||
config.h.in | ||
stamp-h1 | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
AUTOMAKE_OPTIONS=foreign no-dependencies | ||
SUBDIRS = src | ||
EXTRA_DIST = README default_tables.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
1. Short overview | ||
----------------- | ||
|
||
Pinba (PHP Is Not A Bottleneck Anymore) is a statistics server using MySQL as an interface. | ||
It accumulates and processes data sent over UDP by multiple PHP processes and | ||
displays statistics in a nice human-readable form of simple "reports", also providing | ||
read-only interface to the raw data in order to make possible generation of more | ||
sophisticated reports. | ||
|
||
Pinba is not a debugging tool in a common sense, since you're not supposed to do | ||
debugging on production servers, but its main goal is to help developers to locate | ||
bottlenecks in realtime and direct developers' attention to the code that really needs it. | ||
|
||
See "How it works" chapter below if you need more details. | ||
|
||
2. Installation requirements | ||
-------------------------------- | ||
|
||
Pinba requires MySQL 5.1.x sources to be built and MySQL 5.1.x installation to run. | ||
MySQL 5.1 is the first version which supports pluggable storage engines, | ||
so older MySQL versions cannot and will never be supported. | ||
|
||
Libraries required: | ||
* protobuf - http://code.google.com/p/protobuf | ||
* Judy - http://judy.sf.net | ||
* libevent - http://monkey.org/~provos/libevent/ | ||
(this one may be already installed in your system, just make | ||
sure you have -devel package installed, too). | ||
|
||
Optionally used: | ||
* Hoard memory allocator - http://www.hoard.org | ||
|
||
Using --with-hoard option you can add compiled-in Hoard support. It helps to reduce | ||
memory consumption (and Pinba is quite memory hungry when it comes to millions of timers). | ||
2x smaller memory footprint with Hoard is what I regularly see. | ||
|
||
3. Installation | ||
--------------- | ||
|
||
Make sure you have all the required libraries installed and proceed with the compilation. | ||
|
||
3.1. Compilation | ||
---------------- | ||
Unpack Pinba archive and start the good old configure & make procedure: | ||
|
||
# ./configure --with-mysql=/path/to/the/sources/of/mysql-5.1 --with-judy=/judy/prefix --with-protobuf=/protobuf/prefix --with-event=/event/prefix --libdir=/path/to/mysql/plugin/dir | ||
# make install | ||
|
||
--libdir option is required in order to get the library installed into the correct directory | ||
(but you can always put the lib there manually). | ||
Usually the path looks like <MySQL install prefix>/lib/mysql/plugin, so if you've installed | ||
MySQL using /usr/local/mysql prefix, the path should be /usr/local/mysql/lib/mysql/plugin. | ||
|
||
|
||
3.2. Plugin installation | ||
------------------------ | ||
|
||
And then in MySQL console execute: | ||
|
||
mysql> INSTALL PLUGIN pinba SONAME 'libpinba_engine.so'; | ||
|
||
I'd also suggest you to create a separate database, this way: | ||
|
||
mysql> CREATE DATABASE pinba; | ||
|
||
And then create the default tables: | ||
|
||
# mysql -D pinba < default_tables.sql | ||
|
||
|
||
4. How it works | ||
--------------- | ||
|
||
Each PHP process creates a Protobuf message and sends it to the configured Pinba | ||
server on request shutdown. The packet is sent over UDP, so it doesn't affect PHP's | ||
performance in any way. This also means some packets may be lost, as UDP is not | ||
reliable by its nature, but that should not bother you much. | ||
|
||
Pinba server listening to the configured port (see pinba_port setting) reads and decodes | ||
arriving Protobuf messages, adding them to the temporary pool. The temporary pool is needed | ||
to prevent too frequent locking of the main pool, which might slow down the queries. | ||
Once in a while (see pinba_stats_gathering_period directive) Pinba locks down the main | ||
pool of records and adds the records from the temporary pool. It also drops outdated | ||
records (see pinba_stats_history directive) and updates indexes and base reports in the | ||
same moment. Tag reports are also updated, if any. | ||
Both main and temporary pools are implemented as cyclic buffers of limited size, created | ||
on startup and never re-allocated, so newer records always overwrite older ones. | ||
|
||
Well, this is all I had to say so far. | ||
If you have any questions, feel free to ask them in the list - pinba-engine@googlegroups.com. | ||
Send an empty email to pinba-engine+subscribe@googlegroups.com in order to subscribe. | ||
|
||
Have fun. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
SUPPRESS_WARNINGS = 2>&1 | (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|defined in acinclude.m4 but never used|AC_PROG_LEX invoked multiple times|AC_DECL_YYTEXT is expanded from...|the top level)'||true) | ||
|
||
AUTOCONF ?= 'autoconf' | ||
ACLOCAL ?= 'aclocal' | ||
AUTOHEADER ?= 'autoheader' | ||
AUTOMAKE ?= 'automake' | ||
LIBTOOLIZE ?= 'libtoolize' | ||
|
||
config_h_in = config.h.in | ||
targets = $(config_h_in) configure makefiles | ||
|
||
all: $(targets) | ||
|
||
ltmain: | ||
$(LIBTOOLIZE) --force --copy | ||
|
||
aclocal.m4: | ||
$(ACLOCAL) | ||
|
||
$(config_h_in): configure | ||
@echo rebuilding $@ | ||
@rm -f $@ | ||
$(AUTOHEADER) $(SUPPRESS_WARNINGS) | ||
|
||
configure: aclocal.m4 configure.in ltmain | ||
@echo rebuilding $@ | ||
$(AUTOCONF) $(SUPPRESS_WARNINGS) | ||
|
||
makefiles: configure Makefile.am src/Makefile.am | ||
@echo rebuilding Makefile.in files | ||
$(AUTOMAKE) --add-missing --copy | ||
|
||
cvsclean: | ||
@rm -rf src/*.lo src/*.la src/*.o src/*.a src/.libs src/.deps src/Makefile src/Makefile.in src/stamp-h1 src/config.h* | ||
rm -rf aclocal.m4 autom4te.cache install.sh libtool Makefile Makefile.in 'configure.in~' missing config.h* configure stamp-h1 | ||
rm -f config.guess config.log config.status config.sub cscope.out install-sh depcomp ltmain.sh _configs.sed | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
cvsclean=0 | ||
rebuild=0 | ||
|
||
while test $# -gt 0; do | ||
if test "$1" = "--force"; then | ||
rebuild=1 | ||
echo "Forcing buildconf" | ||
fi | ||
if test "$1" = "--clean"; then | ||
cvsclean=1 | ||
fi | ||
shift | ||
done | ||
|
||
if test "$cvsclean" = "1"; then | ||
echo "Cleaning autogenerated files" | ||
${MAKE:-make} -s -f build.mk cvsclean | ||
else | ||
${MAKE:-make} -s -f build.mk | ||
fi | ||
|
Oops, something went wrong.