xgrr.de – the whole not the half

things, thoughts and stuff out of life, daily business and computer science

Archive for the ‘Internet’


Apache2 + mod_fcgid + PHP = Awesome

For years now I was using PHP as a Apache module and not thinking twice about it. Easy to install not much to maintain and working reasonably well. Server too slow? Buy a new server. Recently one of our servers got really slow again with varying timeouts while serving pages. Memory shortage. No new server available I needed to make the most of it and started investigating how to decrease the memory footprint of Apache.

FastCGI was the answer. With PHP as a module installed every Apache process can take up to the maximum amount of memory you defined in php.ini plus what the Apache process needs by himself even though this process is only serving static content. With the switch to FastCGI it was possible to use the threaded version of Apache (mpm_worker). Static contents are now served really fast without need for invoking PHP at all. PHP scripts are served by calling the FastCGI IPC.

As memory is still low Apache and PHP are both configured to “die” after quite a low number of requests served. This can sometimes lead to a small delay while the processes are restarted but ensures that the memory footprint is kept low.

How did I do it? I won’t go into details on how to install Apache, mod_fcgid and PHP because there are loads of howto’s out there. Please find the configuration I’m using below. I’m using Debian and Apache, mod_fcgid and PHP are installed out of the repository. If you have a custom compiled version or different distribution your paths can differ.

Depending on your available hardware it is feasible to tweak the settings for the mpm_worker module so more concurrent clients can be served and/or the amount of requests which is handled before re-creating the thread is higher. It is also very recommended to use eAccelerator in conjunction with this setup. See my post on the topic for more information.

/etc/apache2/apache2.conf (excerpt):

<IfModule mpm_worker_module>
	StartServers           4
	ServerLimit            4
	MaxClients           128
	MinSpareThreads        8
	MaxSpareThreads       16
	ThreadsPerChild       32
	MaxRequestsPerChild  500
</IfModule>

/etc/apache2/mods-available/fcgid.conf:

<IfModule mod_fcgid.c>
	AddHandler fcgid-script .fcgi .php
	FCGIWrapper /var/www/php-fcgi-starter .php

	IdleTimeout		3600
	BusyTimeout		 300
	ProcessLifeTime		7200
	IPCConnectTimeout	  10
	IPCCommTimeout		 360
	MaxProcessCount		  15
	MaxRequestsPerProcess	  -1
	PHP_Fix_Pathinfo_Enable    1
</IfModule>

/var/www/php-fcgi-starter:

#!/bin/sh
PHPRC=/etc/php5/cgi/
export PHPRC
export PHP_FCGI_MAX_REQUESTS=250
export PHP_FCGI_CHILDREN=1
exec /usr/lib/cgi-bin/php

Virtualized Networks – Next Generation Networks [Update]

In professional areas virtualization of servers and workstations enables us to evaluate operating systems and software packages in an isolated environment and without great costs. But this is still the starting point of virtualization. As our current internet topology and software applications ask for integration – the Cloud is a good keyword here – we have to be not only able to virtualize physical PC hardware but also provide network environments which are abstracted from our current internet.

This would enable network engineers, system administrators and of course scientists to easily develop new network infrastructures, test distributed deployments or invent new protocols on top of the network stack. The impact of a commercial virtualization technology for networks would have a huge impact of the way we currently build networks.

With the development of NGN (Next Generation Networks) this idea is pushed by a few selected but until now it did not surface to the broad public.

Update: I made a bit of research on the topic. Nothing deep really but I still found some interesting material:

I also found a lot of sites talking about network virtualization in connection with classic computer virtualization. This is only a part of what is meant. Network virtualization should be an end to end implementation with virtual nodes on the end points itself in the form of a software or firmware on the NIC and also on the nodes in between. It has not necessarily be linked to virtualized servers although this would of course make a lot of sense.

eBooks – Be ready for the Hype with ebook-spot.de

Surely eBooks are discussed controversially in the media. On the one side you have the publishers and the authors who are afraid of losing their market. Then of course you have the papers which turnover is declining as time progresses. Nevertheless digital versions of books, papers and magazines are more and more demanded by the public. With new technology such as the Kindle by Amazon and other high-tech gadgets it is also becoming very easy to consume these digitals.

But then you want more. And there it stops. Where to get your new eBook fix? There are a lot of different sites out there. Most of them feature PDA documents optimized for hand helds. With the enforcing of the market you can easily miss good sources.

With friends of mine I started a portal which collects links to interesting offerings on the net. We already started to gather links to commercial and non-profit organizations. We’re just started a few days back and have almost 100 links together. Have a look for yourself on ebook-spot.de!

The Bittorrent Farce

Due to my relocation to Switzerland during the last few weeks I didn’t have internet and missed of course the impacts of the Pirate Bay closure. Now with internet back in place I realized that it really had impacted the availability of downloads.

I even started to panic a bit but then I realized that 90% of the torrents were still active but on an other tracker. So with simply removing the Pirate Bay tracker and adding the OpenBitTorrent tracker everything works like a charm again. Really helpful for changing the torrents is TorrentEditor.

Collection of the probably most strange obituraries

TodesA_7_BM_Bayern__883337gI just found this strolling through the internet. It seems to reporter started to collect obituaries which are a bit unusual. Now they published a book about them. A collection of the best you can find on Welt Online.

Pidgin Presence Info Fix for ICQ

If you use Pidgin and ICQ you might have noticed that the buddy icon is not transmitted properly if transmitted at all. This is long a bug on the TODO of Pidgin but nobody fixed it yet. I just found a patched version of liboscar.dll and liboscar.so which fixes the buddy icon issue for me perfectly. They already provide a version for the new 2.5.4 release which fixes the recent MSN connection issues.

It might be a good idea to monitor this forum as I hope they will keep on releasing new patched versions until the Pidgin team incorporates them into the trunk.

Native Client (NaCl): A new era of browser based applications and services

You might have noticed the anouncement of Googles new project today: Native Client. In short NaCl is a bridge between the web browser and the computing power of the clients pc. With this bridge it is possible to access the resources of the pc and use them for creating much more CPU intensive web applications than before.

The bridge is implemented as a browser plugin compatible with the NPAPI which features the most current browser except for Internet Explorer. Native Client implementes a redundant sandboxing mechanism to ensure that the module, seen as untrusted code, can do no harm to the underlying operating system. The sandboxing is implemented via various methods described detailed in the research paper published by Google.

With Native Client it is possible to implement applications which can take advantage of the full computing power of the underlying hardware. As sample applications Google implemented Quake I and a fractal application which is able to zoom in and out of the fractals. This shows that this framework offers extensive power to the application.

Heise.de the newsticker of the Heise Zeitschriften Verlag which also publishes c’t, iX and Technology Review described this new piece of technology as: “Browser as the next operating System“. Partly this is certainly true, as the normal boundaries of legacy web applications are blurred. The target market is certainly there. Virtually everybody is using a browser at least once a week. Web based applications such as Photoshop Express can use the power of the clients pc to calculate image operations and so on.

This move was expectable from Google after launching Chrome a few months back. And a lot of the members of the NaCl project are also assigned to the Chromium project on Google Code.

I’m very curious how this technology will evolve and how the acceptance is as there are certain security concerns when browsers or code from untrusted sources can access hardware directly. Even the recent heated discussion about bugs in CPUs can influence the security not only of the standard operating system but also of the untrusted code running in the Native Client.

Does what happens in Facebook stays in Facebook?

Even Google is not always right

20081201_even_googleToday I needed a fuse for my car, so I looked up a car service near work. A colleague told me that A.T.U. is near by so I checked Google Maps. Google maps wanted me to have a 20 minutes drive to a place with a completely different postal code but the same street name. What tells us this? It tells us that Google might be good but they certainly don’t know everything…

Google’s Chrome is a no-show!

chrome's a no-showJust saw the news on Heise Online. But when I wanted to take a sneak at the all new Chrome I was stunned. No way. Again they’ve forgotten to link the right page. It happend before: Google stellt das Licht aus – aber wirklich…