commit activity , generated by statSVN

September 3rd, 2010 - 

I let statSVN ( www.statsvn.org ) generate some..  well ,  stats  , which was quite interesting and not that much hassel. Still, the git guys tell me that these are not very impressive and that I should switch VCS .. Certainly considering this – for the next projects.

php5 start-session issue on ubuntu

September 3rd, 2010 - 

Sometimes this error would pop up

“Fatal error: Uncaught exception ‘Zend_Session_Exception’ with message ‘Zend_Session::start()”

With the crucial line: “ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied”

An explanation and solution is posted here

http://somethingemporium.com/2007/06/obscure-error-with-php5-on-debian-ubuntu-session-phpini-garbage

The source states that for  Debian and Ubuntu, the automatic garbage collection must be set to “off” , for the various php5 packages in use ( e.g. , php-cli ) .

So we have to take care of this in the  php.ini files for the packages in question.

Interesting discussions on the Zend Mailing List

Dezember 21st, 2009 - 

Some discussions on the mailing list that I find helpful or noteworthy ..

http://n4.nabble.com/PageController-ActionStack-vs-Simple-MVC-td948403.html#a948403

http://n4.nabble.com/Problem-with-Zend-Controller-Action-Helper-Url-url-td975540.html#a975540

http://n4.nabble.com/Setup-of-a-modular-structure-td965985.html#a965985

Php / Zend Resources

November 6th, 2009 - 

Currently I’m very interested in PHP & Zend(Framework) resources that deal with enterprise-level architectures , design patterns and refactoring, as well as with ways of plainly mastering the  Zend-Framework , e.g. mastering its complexity and choosing the “right” options for its usage out of the many it provides.

I’m especially looking for some use-cases and tutorials that go a bit further than the basic “how-to use Zend_Form”, “how-to set up MVC” and so on stuff.. That said, this basic stuff is covered nicely  on the Zend-Screencasts blog (video tutorials) .

Slides from the ZendCon09 , that recentrly took place look interesting. That talk caught my attention :  writing maintainable PHP Code , goes into do’s and doent’s about writing PHP code and has plenty of examples on how to refactor, introduces some so called “code smells” that are signs for the need to refactor..

Recently this weblog (The Pope is Dead) has caught my attention , I still have to dive into it but it seems there is some pretty advanced stuff up there.

The posts are written by Keith Pope, who is the author of Zend Framework 1.8 Web Application Development , which I ordered, alongside with  Zend Enterprise PHP Patterns (Expert’s Voice) by  John Coggeshall & Morgan Tocker ..

Might post some reviews about the books  here, once I know more ..

Analysing Mysql Slow Query Log

September 29th, 2009 - 

As one of our hosts reached a 5-minute avarage load of 40 (with 2 cpus) , it’s time to look at the mysql log for slow queries again.

It’s not easy to find the cause for such incidents, as when the load goes up and things go wrong in the database, of course ALL the queries are starting to run slow.

A  good site to start on this topic is always the Mysql Performance Blog . In the comments-section of this entry, I found links to two different scripts analyzing the slow-query log. (Also see the Mysql Performance Blog or the Mysql docs for how to turn on the slow query log in the first place )

MySQL Slow Query Log Filter for PHP5 and Python 2.4

One is MySQL Slow Query Log Filter for PHP5 and Python 2.4 , which goes through the logfile and gathers statistical data like counting the times a certain query occured. The first nice feature is to limit the time range of which queries are taken into account.

This command filters the log to show only queries on the 14th of september 2009, that took 30 secconds or more to execute.

$php mysql_filter_slow_log.php -T=30 --date=14.09.2009-15.09.2009 database-slow.log > output.log

The script , however, regards queries as different unless they match completley. That means that two queries on the same table, just looking up a different row by providing a different value for a key column are not counted as the same query.

For that reason, I changed the script a bit ( patch here ) to remove  all strings inside quotes so that

select * from table where id = '1'

and

select * from table where id  = '2'

end up being counted as the same query .

To use this functionality with the patch applied , start the script with the –preproc option.

MyProfi

The seccond script MyProfi already does “anonymize” the queries , it therefore provides a more summarized overview , with less options though. The output looks like this:

(...)
queries by pattern:
===================
1.    2 986      [ 9.65%] - select{} ....where id = {};
2.    2 750      [ 8.89%] - (...)
(...)

About Lock-Time

Another number I’d like to see would be the Overall Query Time minus the Lock Time , as this would show which queries take long without waiting for locks to be released. This would be the real “bad ones”, as far as I understand this.
The locking issues are probably worse here than they would have to be as all the site’s tables are MyIsam-Tables that use table-based locking (i.e. locking the whole table instead of the rows that get updated / inserted ).

Update: Maatkit mk-query-digest

Another tool, probably far more proffessional than the before mentioned : mk-query-digest.
It has a lot of options, but even with no special options set it provides very helpful output.
Some of the features I noticed from a quick test was that it does the “anonymizing” of the queries , the output features min, max, avg as well as stdv (standard deviation ) and median value.
There’s also a kind of graphical representation of query time distribution , meaning there are ascii-bars that show how many of a certain kind of query got executed within 0.5,1,10 etc. secconds.

I have not looked into the tool in greater detail (as the host runs smoothly again – for now ) , but it seems to be the best solution for analysing your query logs.

Hallo Welt!

September 8th, 2009 - 

On this Weblog I will post news about ongoing projects as well as technical information, developement strategies etc. that seem interesting to me.

Information about my company can be found in the “pages” section to the right.

Lets start with something useful : How to plan an agile startup