If you have a lot of such entries
sh: 1: [[: not found
sh: 1: : Permission denied
in your zabbix_agentd.log and you are on Ubuntu 12.04 LTS then you have the dash shell as /bin/sh DashAsBinSh
I have used the following setup to solve this issue.
echo "select sum($(case "$3" in both|"") echo "data_length+index_length";; data|index) echo "$3_length";; free) echo "data_free";; esac)) from information_schema.tables$([[ "$1" = "all" || ! "$1" ]] || echo " where table_schema='$1'")$([[ "$2" = "all" || ! "$2" ]] || echo "and table_name='$2'");" | HOME=/var/lib/zabbix mysql -N
chmod 755 /etc/zabbix/mysql_size.sh
and changed the original line in
UserParameter=mysql.size[*],/etc/zabbix/mysql_size.sh $1 $2 $3
The FastCGI Process Manager (FPM) is now part of the official php 5.3 branch.
The official site in the php manual can be found here
The official site for the php-fpm project is here
I have searching for a long time for the right webframewor to develop a rather small Webapplication.
The requirement was:
- Usermanagmemtn, ACL
- Manage Files to download by Userpermission
- run behind nginx
I have developed in all of this languages in the past, some of them in mor deep then in the other.
I have take a look about different frameworks in this languages
The main decision to go to the php based symfony framework was:
- It is easy to learn and relativly good documented
- I know php more or less good, not better then perl but the setup was easier to create.
- There are more php known persons in the current company.
My reasons why I have not choose one of the differnt languages to work:
- Java: due the fact that you need to compile it, so you need a IDE (ala. Eclipse). It takes more time to see if you change works.
- ruby & python: I haven’t not enough experience with it. This language looks very nice and easy to learn but it wasn’t necessary that I learn it, yet 😉
- perl: I have develop a lot of perl modules and code in the past but for now I like php more.
So as you can see it is not very academic more pragamtic ;-).
If you have the need to run php with a very high traffic you should think about the follwoing setup.
Don’t think it will work in 5 minutes and you don’t need some knowledge about how to setup an webserver and a php application, you definitely need it.
If you think this is a step by step description for people which only want to copy and past commands and it works then you are wrong here, please take a websearch engine for a alternative description.
What you need:
- nginx http://www.nginx.net/
- php-fm http://php-fpm.org/
- php http://www.php.net/
- a compile environment
- the development libraries for the wanted php features and libxml2
- A clear test scenario and target how many requests per second should be reached on static and dynamic part.
How you can build this environment:
- Extract, build and install nginx http://wiki.nginx.org/NginxGettingStarted
- Extract, build and install php-fm http://php-fpm.org/wiki/Documentation
- configure nginx for fast-cgi proxying http://wiki.nginx.org/NginxHttpFcgiModule
A brief description how the flow is:
- A request comes to nginx
- He takes a look into his config to find the right location or server config
- If the static content rule matches then he will deliver the content directly from the disc
- If the dynamic rule matches the he will contact php-fm, which manage the php-instances
- php-fm execute the php script and send the dynamic content back to nginx
- nginx sends the content back to the client
There are some pitfalls:
You should take your time to find the right config setup for nginx and php-fm to be able to fulfill the assumed traffic.
I have started to translate the russian documentation, which is still not complete.
UPDATE: There is now a official wiki http://php-fpm.org/