The rants and raves of a technogeek
Archive for October, 2008
A2Billing+Apache vs. A2Billing+Lighttpd
Oct 14th
Ok, it goes without saying: “A2Billing is one of the most complete Calling Card systems in the Asterisk market today.” – on the other hand, it is also true that: “A2Billing is one of the most complex and convoluted pieces of code ever written!”.
The combination of the above makes for a fairly combustible mixture, especially if you have a big system. Now, I recently ran into an issue, where PHP was litterally eating up almost 512MB of ram, in order to run the A2Billing reports. In it self, that didn’t make much sense to me. However, after inspecting the code, and realizing that A2Billing uses GD in run-time to generate images out of thousands of CDR records, it made perfect sense that it may just be eating up memory.
So, increasing the memory on PHP to go up to 512MB of RAM helps, but creates an interesting probelm. Whenever Apache will invoke a script, it will automatically consume a shitload of RAM, and for each time I intiate a new query, it will spawn a new Apache instance, and consume the same amount of memory. That said, after 6 queries of 512MB, about 50% of the machines RAM was already eaten up – and Apache will not free it!
At this point, I had 2 choices:
- Go into the A2Billing code, change the GD code to work right or simply change it completely to something else (maybe flash).
- Work around the problem with a mix of proper IT practices.
I admit that I hate quite a lot of things (I won’t list these here); however; nothing ranks up the list as modifying someone elses code, when I know for fact that it will be unmaintainable in the future. So, I choose option number 2.
I’ve being playing alot with Lighttpd lately, and got some really nice performance from it. So, I said to myself, this would be a great test to see if Lighttpd+FastCGI can solve the problem here. I had to work my way around lighttpd to do what I wanted and verify that my FastCGI server in Lighttpd doesn’t consume all memory, however, here is what I got working with A2Billing, and really nice.
Step 1: Enable the required modules:
server.modules = (
"mod_access",
"mod_auth",
"mod_status",
"mod_fastcgi",
"mod_accesslog" )
Step 2: Enable the FastCGI Server
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/var/run/lighttpd/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi",
"idle-timeout" => 30,
"max-procs" => 1,
"min-procs" => 1
)
)
)
Step 3: Modify user permissions (required if you are using FreePBX)
server.username = "asterisk"
server.groupname = "asterisk"
Step 4: Setup authentication and authorization (optional)
#### auth module
## read authentication.txt for more info
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/var/www/.htpasswd"
auth.require = ( "/" =>
(
"method" => "basic",
"realm" => "A2Billing Management",
"require" => "valid-user"
)
)
The above configuration made the interface spwan a single FastCGI, insuring that memory usage is never over utilized. I still need 512MB of RAM to run the scripts, but at least now it’s limited to only 512MB of RAM, out of a machine that has 16GB of RAM.
Zip up, Slim down, let the heads roll…
Oct 12th
Like most of the world, I’ve been following the recent market turmoil with a great burden on my shoulder. When you think about it, I’m not a stock broker, nor am I a multi-billionaire that has his funds invested in various stocks and bonds, that a single 0.1% shift in the NASDAQ translates to millions of dollars. I’m a software developer, a freelance one, dealing in the Open Source – and like anybody else, I’m worried about how this crisis immediately affects me.
Today, I came across two items, post on www.themarker.com – Israel’s topmost Internet based financial/business daily. The two items dealt with how three of the better known VC’s in Israel had started instructing their investees to start cutting down costs – mainly, firing people. The three VC’s that I’m talking about are: Carmel Ventures, Benchmark Israel and Sequoia Capital. You are probably wondering why is this interesting? the VC’s in the item had directly instructed their investees to cut down people, costs, operational costs, loose dead weight – in other words, find ways to reduce your costs. Sequoia even out did Carmel and Benchmark, by inviting the investees to a meeting called: “RIP: Good Times”!
Shortly after I finished reading the two items, I got a phone call from a friend working at one of Sequoia’s companies (a well known one in Israel) asking me if he can come work for me. I was surprised, this is the first time I’ve ever read something in the news, and was directly affected by it. As far as I gathered, his company basically took a team of 8 people and reduced it to 2. Now, I completely understand tightening up, but running an operation on a 25% man power is stupid! Running at 50% is manageable, but 25% is down right crazy. For 2 people to do the work of 8, they would need to eat, drink, sleep, live, do everything within the office – I know, I’ve been there. During the year 2003, m-Wise was more or less in the shit. In the year 2002 I had a team that consisted of another SysAdmin and 3 more support techs. In 2003 I was left alone, and I basically did everything myself! – how crazy is that. But again, I decided that I’m not going to have a life for a certain period of time – that is all, not everybody is willing to make that sacrifice.
Now, this case goes hand in hand with my previous post – the migration to Open Source technologies is no longer a myth or a “nice-to-have” issue, it is a matter of business continuity and good expense management. Think about it, the company that fired 75% of their team, could have easily replaced part of their server infrastructure from Windows to Linux, migrate their Oracle database to PostgreSQL and save thousands and thousands of dollars a year, and maybe even save a job or two in the process.
Now, here’s what I think (and I know for fact I’m gonna get slammed here): Hey, VC’s, stop telling the companies to let go people. Sure, get rid of dead weight – no one needs those M$ based shitty, money grabbing, time consuming, hardware intensive environment. Wouldn’t it be better to not pay M$ a few ten’s of thousands of dollars a year, and maybe save a man’s job, or maybe even 2? M$ has enough money of their own, all you are doing is making sure they keep on making money, while the rest are fighting for their lives. Why don’t the VC’s hire Open Source consultants, to help them examine their investees and maybe, just maybe, they will find ways to invest their funds in a wiser way and help these companies to survive the current financial turmoil.
We’re melting, we’re melting…
Oct 11th
I’m not much of an economist. I understand income and expenses, I understand more or less how the stock market works from time to time, but I’m no economist. I’ve been in the hi-tech industry since early 1997, which means, that I’ve seen this world being elevated to the level of godly hood, buried alive with the explosion of the dot.boom era, only to re-invent itself as a highly competitive telecom’s industry and the “Network is the Computer” manner of thinking.
About 2 weeks ago, a man I truely admire had written a post entitled: Economic Meltdown – Friend or Foe of Open Source? (written by Danny Windham, CEO of Digium). Danny talks about the various aspects of companies cutting down on their IT budgets and reversion to Open Source technologies, as a means to hedge needed cash. As I witnessed the Dot.Boom explosion of 2001, I can honestly say that 2001, at least as far as I can say, was the year that Open Source technologies had truly assimilated to the normal business practice of companies. Even beyond that, companies which were not based on Open Source and Linux/Unix based technologies were clearly not a valid option for investors.
One of the urban legends talks about Hotmail wishing to acquire an Israeli company called Commtouch, back then, a webmail company. Commtouch was purely based on Windows NT technologies back then, and while the business track of the negotiations were going fine, the deal collapsed as the technical sides, of a back then BSD based Hotmail, basically negated the deal. Now, I have no idea if the story is true or not, again, this is an urban myth, however, I believe myths are usually based on some portion of the truth - at least to an extent (even a small one).
While the adaptation of Open Source technologies is a must for companies, in order to survive the troubled waters of these time, it is highly dependant on the solution providers, consultants and IT outsourcing companies. In Israel, for example, it is very much a customary to hire outsourced IT assistance, on a part time basis, allowing you to cut your IT costs. When bringing in IT assistance, you’re not only bringing in IT assistance, you also bring in IT governance and IT policies – as an outsourced IT person will usually operate under the terms he had learned in his company. If his company is a M$ oriented company, no matter how Open Source will be crucial to the business, M$ will still rule the domain in that area. I believe that the first thing that needs to happen is for the consulting and IT outsourcing companies to realize that they need to change, first for their customers, then for themselves. If the small start-up companies and established companies will start falling, the consultants will simply dry out of work.
It is our responsibility as IT/Telecom/Development/Architecture/Design consultants to explain the aspects of using Open Source, assimilating it, integrating it, both the pros and the cons and then, assist our customers in doing so successfully – this is the only way to go.
For example, let us take examine the following scenario – a telephony service provider. Our telephony service provider is based on Asterisk as the switching environment, a purely M$ base for all the billing, web front-ends, databases, development and so on. Their entire IT infrastructure is fully owned by them, all running with ESX servers and other proprietary technologies. This company will be required to pay hundreds of thousands of dollars every year, for support purposes (and the year is coming close to an end), their expansion is highly dependant on 3rd parties and while they are self sufficient on the IT side, they are purely dependant on the technology side. Now, imagine that this company would have had their entire back-end based on Open Source technologies, let’s imagine PostgreSQL and Ruby on Rails as the web frame work, how much money will that save per year? now, let’s remove ESX out of the equation… let’s also remove non-Open storage solutions and replace those with CoRAID or something similar, we’ve saved hundreds of thousands of dollars on an annual basis. Radical? – YES! But drastic times call for drastic measures, and when drastic measures are required, Radical solutions are a must.
Tux Violation – Calling all Tuxes
Oct 8th
OK, saying that the Tux pengiun is cute and fuzzy, and saying that it is one of the cutest mascots in the world is one thing. But using it as the logo of a company that manufactures “Fever Pads”, now that’s something completely different.
The following image was taken using my cell phone, when I was visiting “Super Pharm”, in Eilat. For all the people not from Israel, “Super Pharm” is the Israeli equivalent to the American “Duane Reede” (NYC) or CVS (world wide) or the UK based Boots.

Linux based Fever Pads
So, what do you think, are these guys using Linux as an integrated part of their “Fever Pads”?
I’ve been out of the cell world for a while…
Oct 8th
Most of the readers of this blog know me for my work with Asterisk, the Open Source PBX. However, prior to working with Asterisk, I was heavily involved in the Kannel Open Source WAP/SMS gateway project. That was during a time I spent (almost 6 years), at a mobile content management and delivery company called m-Wise.
Back then, I can remember the craze of getting a new ring-tone for my phone. Shortly after to be replaced by polyphonic ringtones, soon to be replaced by tru-tones and so on. In any case, I’ve been so out of it, that I didn’t really care what ring tone was on my cell phone. Added that you need to pay for each ring tone, made for a fairly costly habbit to change your ring tone every 2-3 days.
In any case, as I wrote a couple of months ago, I recently acquired a new Nokia E90 phone – I have to admit, the best work phone I ever had till this day. In any case, I was really looking for a nice website that carries ring tones, especially, the old Knight Rider theme (yes, I’m an OLD GEEK!). Seeking the internet, I came across this service MyXER. MyXER is available at http://www.myxer.com/, allowing its visitors to download Ring Tones, themes, wallpapers and more to their cell phones for free – well, most of the stuff is free, some costs about 2$ per download.
I’ve also added a small widget on the right hand side of the website to allow you to listen to my ring tone, go over to MyXER and download what ever content you want from there, too.




Picasa
Twitter
Facebook
LinkedIn
Youtube
RSS