March 2006
Monthly Archive
Posted by Cody Mays on 30 Mar 2006 10:29 pm. Filed under
Geekery ,
Site News ,
FreeBSD ,
Personal ,
Daily Grindage.
Well, this server hit 150 days of uptime today. :)
cody@devnulled:/home/cody>uname -a
FreeBSD devnulled.ath.cx 5.4-RELEASE-p7 FreeBSD 5.4-RELEASE-p7 #0: Sat Sep 24 21:10:00 EDT 2005 root@devnulled.ath.cx:/usr/obj/usr/src/sys/DEVNULLED i386
cody@devnulled:/home/cody>uptime
10:30PM up 150 days, 8:52, 1 user, load averages: 0.05, 0.03, 0.00
Posted by Cody Mays on 23 Mar 2006 8:37 pm. Filed under
Geekery ,
PHP ,
Web Development ,
Tips and Tricks ,
Apache ,
Personal ,
Daily Grindage.
I’ve had one insanely sweet idea for a website last Sunday. So after I got home today, I worked on building a php6 installed. I must say it’s not easy. I could not get the direct cvs checkout to compile correctly. It seems to me that flex and yacc weren’t generating the parser and I didn’t feel like fixing.
So I headed on over to snaps.php.net and downloaded a prebuilt cvs export. After installing at least 15 libabc-dev packages via apt-get, I was ready to build. So I started it and saw something about ICU. Well it turns out, the Ubuntu package isn’t up-to-date enough. PHP 6 requires ICU 3.4+. So I had to compile all 8.5mb of that code. Make sure that you run ./configure like this on ICU (according to the one thing I found on google about it, let me know if it works differently) ./configure –prefix=/usr/local/ –disable-threads
Here is what I build my PHP 6.0.0/dev install with:
./configure –program-suffix=6 –with-apxs2=/usr/local/apache2/bin/apxs –enable-openssl –with-zlib –enable-bcmath –with-bz2 –enable-calender –with-curlwrappers –enable-dba –with-inifile –with-flatfile –enable-exif –enable-ftp –with-gd –with-gettext –enable-mbstring –with-mcrypt –with-mhash –with-mime-magic –with-mysql –with-mysqli –with-unixODBC=/usr/ –with-readline –with-mm –enable-soap –enable-sockets –enable-sysvshm –with-tidy –with-xsl –with-icu-dur=/usr/local –disable-mbregex
Now, I’m off to mess with my long wanted namespaces in PHP.
Posted by Cody Mays on 18 Mar 2006 12:47 am. Filed under
Geekery ,
C/C++ ,
Programming ,
Personal ,
Daily Grindage ,
Experiences.
I got the bug worked out of Jayant today. It can now serve 10,000 concurrent requests in a measly 3.7 seconds according to apachebench. :) The bug was that recv was returning 0 due to it receiving no data. I never checked for zero, but only negative one, so the thread would sit in an infinite loop.
A release should be coming soon, I started the subversion repository today and setup the cia.navi.cx hookscripts.
You may have noticed this site was down today for about two hours. I upgraded my server’s php installation and all the modules with it, so hopefully we get some performance benefits, but I doubt it. At least we know there are less bugs in the setup. :)
More tomorrow, for now bed.
Posted by Cody Mays on 12 Mar 2006 11:03 pm. Filed under
Geekery ,
C/C++ ,
Programming ,
Personal ,
Daily Grindage ,
Experiences.
Since Friday afternoon, I have been working on JayantHTTPD trying to get it to serve up pages threaded style, using a worker thread model. It took research on Friday night and all day Saturday to get it going, but I have succeeded.
The first main issue I had was figuring out how to dynamically allocate an array for the number of threads set in the configuration file. Since I’m used to C++, we never malloc’d our arrays, we used things like std::vector. The solution to this issue was amazingly simplistic. Just a threadinfo_t* workers = (threadinfo_t*)malloc((sizeof(thread_info_t)*server->maxthreads)); :)
The next bug I found coming from the old crappy threading system was that it closed stdin, stdout, and stderr… I have no clue how I didn’t see this, nor why I’m even mentioning this embarrassing, n00by mistake, but I am.
Then once I had all of this handled, I had the file descriptors getting completely owned. I’m still not 100% sure what was up with them, but for instance, changing the following:
to
Fixed one issue. The first code snippet will always return fd 1. No idea why, which caused some interesting actions when the thread went to send the page. ;) After this was fixed, I had to go through and convert some library calls to be thread safe, but this sadly still didn’t fix the handling of the requests.
As of this very moment, I’m still working on the actual handling of the requests. Right now it sends a 200 OK then dies before another if statement. Example:
So this is how I spent my weekend. You can see my active social life gleeming through, eh?
Posted by Cody Mays on 8 Mar 2006 11:12 pm. Filed under
Geekery ,
Personal ,
Daily Grindage.
A few months ago, I bought an SGI 1100 1U server off of ebay for $200. It is brand new and has never been used. The guy that sold it was an SGI dealer and parts them out to increase his earnings. On my road to rebuilding it, I’ve been in search for a matched pair of Intel Pentium 3 1Ghz socket 370 processors and as of 15 minutes ago, I found and purchased some.
So the SGI is on it’s way to being rebuilt. All I have left to buy is some ram and a few heatsinks. :) This site may be moved to that server, I don’t know yet. I do know one thing for sure, the SGI is as loud, if not louder, than a vacuum. These 40mm fans just do not support sleep mode of the human being that controls them. So I’m working up a deal with my father to get the basement wired up for our internet because we have a dedicated dsl phone line for it, due to static in the others.
That’s your blurb for today, stay tuned.
— Next Page »