Lessons learned:
Mysql: You should not use inndb tables, instead use myisam as it will run much leaner. Even with tweaking the "my-small.cnf" mysql was using %20 of memory (Total memory on device is 128mb). After converting innodb tables to myisam and disabling innodb alltogether mysql memory usage was down to only 5%.
Asterisk: While it seemed like a good idea to try out the "Low Memory" compiler flag in asterisk because of the limited available memory on a router, turns out it is quite unstable and resulted in a segmentation fault on my router. While I still intend to research this further, I'd advice to be careful with this one. As far as call quality I would recommend avoiding processor intensive codecs such as g729 or gsm. Also I would avoid scenerios in which the audio stream needs to be transcoded (i.e. having a sip trunk which utilizes gsm and client phones using g711). Because of the low processing power available, I would match the codecs of your phones with that of your primary sip trunk.
Apache: Can be replaced by lighttpd and you will save a bit of memory. But really the big memory hog here is not apache itself but rather php. I am currently using the prefork module and have tuned it to use less memory but am investigating using the worker module as some have suggested it runs more effeciently.
Webmin: While it comes with its own webserver I thought to try hosting it under apache. This is not recommended, sure there were memory savings but at the cost of not being able to use advanced themes. The webmin site discourages doing this.
Overall my goal was to get the lamp stack to use as little memory as possible as on my system the only thing I was "hosting" was the freepbx page and the only user is me. If the 128mb rt-n16 was configured as a dedicated web server and tuned properly you would be able to have about 30-40 concurrent connections to the webserver by my estimates. For a small business or personal webpage this could still be quite useful.
|