When I figured out the cost effective internet I can have with good uplink and downlink bandwidth, I immediately wanted to host a webserver from India. This is because I wanted Local visitors to get good speed and performance with my applications. So I noted down some requirements for this server.
This webserver should not occupy much space
- Should be high performance
- Should not heat up a lot as cooling will be very costly in India
- Should not cost much.
- Should consume very less power
In search for balance between all these requirements I used old Mini PC purchased from croma about two years back for Rs. 13,000. To cut the heating and increase the performance I replaced the HDD with 120 GB SSD. I had spare 512 MB DDR2 Laptop RAM which I could use in this Mini PC without any problems. As such this machine doesn’t heat up much externally but to make it long lasting, I removed the lid and added Laptop USB Fan. This drastically brings down the temperature and helps during summer time.
- Installed Basic Linux, Apache, MySQL, PHP
- Few add ons like Memcache, Sensors, Monitorix.
- Configured httpd.conf for few Virtual hosts.
- NATing on Router to send traffic to local server.
- Updated DNS to send traffic to this server (You need to have static IP from ISP for that).
Web script to monitor heat and memory utilisation from anywhere.
<?php $output = shell_exec('sensors'); echo "<pre>$output</pre>"; $output = shell_exec('vmstat -a'); echo "<pre>$output</pre>"; ?>
Output in Page looks like this
nouveau-pci-0200 Adapter: PCI adapter temp1: +56.0 C (high = +95.0 C, hyst = +3.0 C) (crit = +95.0 C, hyst = +2.0 C) (emerg = +135.0 C, hyst = +5.0 C) coretemp-isa-0000 Adapter: ISA adapter Core 0: +46.0 C (crit = +100.0 C) f71858fg-isa-0a00 Adapter: ISA adapter +3.3V: +3.31 V 3VSB: +3.31 V Vbat: +3.12 V fan1: 2008 RPM fan2: 0 RPM ALARM fan3: 0 RPM ALARM temp1: +49.6 C (high = +70.0 C, hyst = +60.0 C) temp2: +48.2 C (high = +100.0 C, hyst = +85.0 C) temp3: FAULT (high = +100.0 C, hyst = +85.0 C) procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- r b swpd free inact active si so bi bo in cs us sy id wa 0 0 0 105968 708304 301072 0 0 8 11 261 65 3 1 97 0
Monitorix Tool output page to keep a watch on utilization and Load…
I am happy to share that this server is running 24 hours a day for more than one year now without any crashes.
- Most of the times I was cautious, I only sent limited traffic to this server. I am planning to increase the load on this in coming days.
- In India there is no guarantee of continuos power source and Internet connection so you need to have some backup plans.
- I am still in process to see how much load Raspberry Pi based werbserver can handle… Wish me luck and I’ll post that soon 🙂
- Last year Intel has also released Galileo, NUC and Edison formats for small machines. Lets see which one fits my need and pocket.
I feel this is good information for anybody to jump start hosting server in locally in India or any country. In case if you have any specific questions or doubts feel free to write in comments section. I’ll try to answer those…
Mini PC Power Adapter
Mini PC before hardware customisation