Hello! I am Sumit, a nomad, trying entrepreneur and software engineer. I blog about mental issues, personal journey, software and product development.
This is my personal space and my views might seem contradictory to yours. That is OK, my views are not set in stone. This is a place where I share my learning as a human.
Try not to take anything I share as advice. They are just my logs as a I grow, if they help you, great! Share yours too and I will be happy to read. Cheers!
Tuesday, September 27, 2011
Shift from mod_wsgi to uwsgi
I had the task to figure out what are people saying in general about nginx + uwsgi. So yesterday and day before I scouted the Internet for blogs or discussions regarding the same. And it turns out, as I hoped, that nginx + uwsgi is a leaner approach to the application serving platform. Also uwsgi seemed very well documented, managed and commercially supported as some folks mentioned. And there were quite a few articles detailing benchmarks comparing many platform choices for a Python based application. nginx + uwsgi fared better than the Apache alternative and almost everywhere I looked people mentioned nginx + uwsgi to be production grade. There are options which are better, but we preferred one which seems to have a larger following or community.
So we decided to take the plunge. Well the transition was smooth, or at least not troublesome at all. Most of the documentation is available here, here and here. Installation for us for very straightforward. We are on Ubuntu 10.04 LTS. We wanted to upgrade to the new 1.0 series. So we downloaded that, compiled and installed. Please remember you may need to change the config paths. We had to do some of that since our deploy + app reload scripts were dealing with the default Ubuntu install paths. After that just get uwsgi and again compile. That is it, you are done with the software part of it!
After that just follow the examples and docs I pointed out above. For us, we just had to change the proxy_ settings to corresponding uwsgi_ settings. Other than that, we needed to create ini files for uwsgi to run the apps properly. I could not figure out how to run a single instance of uwsgi that will read all stanzas from an ini file and run them all. Well so we are running two uwsgi daemons. Good enough for now, we will come back to the issue later on. Thus we have an updated AMI and we are actually flipping our application servers today. We do not expect any noticeable downtime. Well now lets get back to work :)
Wednesday, April 04, 2007
I uninstalled sqlite on my Linux box !!!
Well I somehow felt I could yum erase sqlite since I do not need it. Well I did not see the dependencies that would be removed too! The result:
yum, rpm, php, httpd, rpm-python and many related packages all Erased !!! OMG I said. :P
I am not very friendly with Linux as yet at this level. I knew I had screwed all hopes of getting that box in clean shape. I searched the net for "reinstll RPM", "install RPM" and similar. Got a link to How to reinstall rpm
In case you can not reach to it, it says something like:
I guess you could try :
- Copying the "rpm2cpio" binary from another machine
- Copying the rpm package locally
- Running something like :
cd /
rpm2cpio /path/to/rpm-4.*.rpm | cpio -dimv
Then you could clean up what you just did (in case it's a different version of rpm, mainly) :
rpm -e --justdb --nodeps rpm
rpm -Uvh /path/to/rpm-4.*.rpm
YMMV...
Matthias
That gave me some hope. I followed the instructions. Switched to root user, went to / and executed rpm2cpio with the downloaded rpm of RPM itself. RPM
Then got an error about librpm shared lib missing. So downloaded librpm. Now rpm works!!!
Now I just searched for the latest versions of rpms for getting yum up and running. This included sqlite, python-sqlite, rpm-python, yum-metadata-parser, urlgrabber, etc. And finally installed yum !!!
I mainly used rpm.pbone.net for searching rpms
Well thats it: I am almost saved :D
Thursday, March 08, 2007
My laptop: my local web server
AMD Turion64 (single core) 2.0Ghz
Hyper Threading support
512MB DDR2 system memory (I upgraded that to 1GB)
nVidia 6150 graphics chip-set with shared memory
14.1" display
60GB SATA hard disk drive
DVD/CD R+RW
Bluetooth
Ethernet
Wireless Lan
At sub Rs. 40,000 (sub US$ 900) this was a great deal. I was using Fedora Core 6 (64bit edition) on it but was not using it much since I still love my desktop and do not have enough work to justify simultaneous usage of two computers. Recently my friend planned to join me on web development work and I thought this was a good time to use it regularly. So I had to first make sure the Wireless Lan worked since I Fedora had not done that automatically. I read:
"Compaq Presario V3000 with Ubuntu 6.06" and it helped a lot. Actually I got the Wireless Lan running in no time. It was very easy. If after a shutdown or restart you need to connect just use the usual commands (iwconfig, iwlist, dhclient to scan for network, connect, etc.).
I setup up my usual structure for web projects. PHP was already there, so was Apache. A few needed PHP modules were added (APC, MagickWand for ImageMagick) and I had a working local web server !!!
Things are really that easy if you are using the right software :) and there is always Google to help you when need it.