Eli

To content | To menu | To search

Monday, September 20 2010

Tricks to speed up Eclipse Helios PDT

Tricks to speed up Eclipse Helios PDT

logo-eclipse-helios.png

Eclipse can be slow, very slow, here's some quick steps to increase Eclipse PDT speed.

Download the latest version of Eclipse and Java

You must upgrade to the latest version in the official Helios download page
A note of the latest version of PDT that make interesting changes, check this page to know more about them.
Upgrading Java Virtual Machine is also essential.

Eclipse PDT Configuration

Add more RAM to Eclipse

Open configuration file eclipse.ini in your Eclipse installation folder, then add more memory, and restart.

--launcher.XXMaxPermSize
512M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms256m
-Xmx512m

Maybe buying more RAM for your computer can help if you have a lot of applications launched at the same time.

Disable Eclipse validators

By default, all code validators are running, go to Windows > Preferences > Validation and uncheck validators you don't need.

Disable Plugins you won't use and startup builds.

Go to Windows > Preferences > General > Startup and Shutdown and uncheck plugins you don't need.
Don't forget to disable startup automatic builds.

Disable Eclipse PDT automatic build

Go to Windows > Preferences > General > Workspace and uncheck build automatically.

Eclipse Helios use

Close any open PHP projects not used

Open project are refreshed, build, and validated even if you don't use them, right-click on Project > Close project, this will free some memory.

Make your projects smaller and create multiple small PHP projects instead

Having a whole big project is not a good idea, divide them into smaller project, and close the one you don't use or you don't need.

Avoid project on network disk

Network disk latency and slow access can really slow your eclipse, especially if you don't have disabled builds, use a version control system and checkout it on your local disk.

Defragment your local disk

Simple isn't it.

Feel free to comment or add your own tips.




Tuesday, September 7 2010

How to make Apache log real scriptname and execution time with mod_rewrite and LogFormat

In our way to improve websites performances, we find one way to make profiling through Apache access log because not only it show us every script called, but it can also tell us the time taken to execute theses scripts.
So we can track Google crawl bot performance on our websites, and slow scripts.
Let's take a look at LogFormat options.

Default LogFormat

By default, Apache log all requests with

"%h %l %u %t \"%r\" %>s %b"

Example :

192.12.1.1 - - [31/Aug/2010:14:53:06 +0200] "GET /index.php HTTP/1.0" 200 3535

%h : Remote host : 192.12.1.1
%l : Remote logname : -
%u : Remote user : -
%t : Time of request : [31/Aug/2010:14:53:06 +0200]
%r : Request : GET /index.php HTTP/1.0
%>s : HTTP status : 200
%b : Size of response : 3535

When you got a lot of rewriting, %r only show the user request (eg : rewrited URL) and if you want to analyse and find what script is slow, it's a pain to apply rewrite rules when parsing logs

Custom LogFormat

One solution is to use %f, %D, %q to add some better and more useful reading in logs

%f show the script file which is called after all rewrite rules are applied
%D show the time taken to execute the script
%q show the query string after all rewrite rules are applied

With a CustomLog format like this (removing remote logname and user since we don't use authentication via Apache)

"%h %t \"%r\" \"%f%q\" %>s %b %D"

To use it, use the code bellow in your vhost file

LogFormat "%h %t \"%r\" \"%f%q\" %>s %b %D" vhost_profile
CustomLog logs/access_log vhost_profile

Then restart httpd, and it every request will be logued like :

192.12.1.1 [31/Aug/2010:16:04:28 +0200] 
"GET /some/complex/rewrite/with-parameter-and-no-script HTTP/1.1"
"/data/htdocs/some/folder/index.php?some=var&putby=rewrite_mod" 200 3535 23351

For comparison with the Default LogFormat :

192.12.1.1 - - [31/Aug/2010:14:53:06 +0200] 
"GET /some/complex/rewrite/with-parameter-and-no-script HTTP/1.1" 200 3535

%h : Remote host : 192.12.1.1
%t : Time of request : [31/Aug/2010:16:04:28 +0200]
%r : Request : GET /some/complex/rewrite/with-parameter-and-no-script HTTP/1.1
%f : Filename : /data/htdocs/some/folder/index.php
%q : Query string : ?some=var&putby=rewrite_mod
%>s : HTTP status : 200
%b : Size of response : 3535
%D : Script execution time : 23351

We now get the time in microseconds taken to execute the page (23351) and the real script called, with the real query string, also it show the URL called when you make a redirect (301, 302, ..) via a Rewrite Rule.

Now we can use a log parser to analyse this.

Resources

Apache 2.2 mod_log documentation : http://httpd.apache.org/docs/2.2/mod/mod_log_config.html




Wednesday, August 25 2010

Memcached 1.4.5 for Windows

NorthScale has built and posted packages of Memcached server version 1.4.5 for Windows to the community.

New Features of version 1.4.5

  • reclaimed : This stat reports the number of times an entry was stored using memory from an expired entry.
  • sasl_pwdb : For more simple auth deployments


Download

You can download it from Northscale Labs http://labs.northscale.com/memcached-packages/ :

Memcached 1.4.5 Windows (64-bit) memcached-1.4.5-amd64.zip
Memcached 1.4.5 Windows (32-bit) memcached-1.4.5-x86.zip




Tuesday, August 17 2010

libMemcached 0.43 released

A new version of libmemcached the open source C/C++ client library and tools for Memcached server have been released.

Release notes :

  • Added --args to memstat so that a greater range of values can be returned.
  • Prelimanary support for Windows.
  • memcached_stat_execute() merged.

You can download it from : http://download.tangent.org/libmemcached-0.43.tar.gz




Wednesday, July 28 2010

PHP 5.2.14 released

This release focuses on improving the stability of the PHP 5.2.x branch with over 60 bug fixes, some of which are security related.

This release marks the end of the active support for PHP 5.2.
Following this release the PHP 5.2 series will receive no further active bug maintenance.
Security fixes for PHP 5.2 might be published on a case by cases basis.
All users of PHP 5.2 are encouraged to upgrade to PHP 5.3.

Release notes

Security Enhancements and Fixes in PHP 5.2.14 :

  • Rewrote var_export() to use smart_str rather than output buffering, prevents data disclosure if a fatal error occurs.
  • Fixed a possible interruption array leak in strrchr().(CVE-2010-2484)
  • Fixed a possible interruption array leak in strchr(), strstr(), substr(), chunk_split(), strtok(), addcslashes(), str_repeat(), trim().
  • Fixed a possible memory corruption in substr_replace().
  • Fixed SplObjectStorage unserialization problems (CVE-2010-2225).
  • Fixed a possible stack exaustion inside fnmatch().
  • Fixed a NULL pointer dereference when processing invalid XML-RPC requests (Fixes CVE-2010-0397, bug #51288).
  • Fixed handling of session variable serialization on certain prefix characters.
  • Fixed a possible arbitrary memory access inside sqlite extension. Reported by Mateusz Kocielski.d.

Key enhancements in PHP 5.2.14 include:

  • Upgraded bundled PCRE to version 8.02.
  • Updated timezone database to version 2010.5.
  • Fixed bug #52238 (Crash when an Exception occured in iterator_to_array).
  • Fixed bug #52237 (Crash when passing the reference of the property of a non-object).
  • Fixed bug #52041 (Memory leak when writing on uninitialized variable returned from function).
  • Fixed bug #51822 (Segfault with strange __destruct() for static class variables).
  • Fixed bug #51552 (debug_backtrace() causes segmentation fault and/or memory issues).
  • Fixed bug #49267 (Linking fails for iconv on MacOS: "Undefined symbols: _libiconv").

For a full list of changes in PHP 5.2.14 see the see the ChangeLog.




- page 7 of 11 -