Warning: sem_get() [function.sem-get]: failed for key 0x152b: Permission denied in /home/dossy/htdocs/wp/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 98
Dossy's Blog: AOLserver

Archive for the 'AOLserver' Category

Progress on nsjsapi running jQuery under AOLserver

Wednesday, October 24th, 2007

It’s not fully baked yet, but let me take a break from coding to … squee! You have no idea how excited I am right now.

Back in February, I blogged about nsjsapi, an AOLserver module that makes the SpiderMonkey JavaScript interpreter (written in C) available to Tcl. Then, in July, John Resig blogged about env.js, which he used to load jQuery under the Rhino JavaScript interpreter (written in Java). env.js is neat because it’s a JavaScript implementation of a basic browser and DOM environment which isn’t provided by either SpiderMonkey or Rhino.

However, env.js assumes its running under Rhino, or at least has all the java.* and javax.* and org.w3c.dom.* APIs available, so it doesn’t completely work under SpiderMonkey. So, I’ve set out to implement all those missing bits in JavaScript, in nsjsapi.js. (Yes, I know I’m crazy …)

After a few days of furious coding and much head-desking, I’ve gotten far enough that I can do this from an AOLserver control port:

nscp 1> set js [js create]
js0x88e0838
nscp 2> js load $js /home/dossy/htdocs/js/nsjsapi.js
undefined
nscp 3> js load $js /home/dossy/htdocs/js/env.js
undefined
nscp 4> js load $js /home/dossy/htdocs/js/jquery-1.2.1.js
undefined
nscp 5> js eval $js {jQuery.fn.toString = DOMNodeList.prototype.toString; true;}
true
nscp 6> js eval $js {window.location = 'test/index.html';}
undefined
nscp 7> js eval $js {$('body').html()}
<div><span id='foo'>This is a test.</span></div>
nscp 8> js eval $js {$('div').append('<span>Hello world!</span>')}
[ <div> ]
nscp 9> js eval $js {$('body').html()}
<div><span id='foo'>This is a test.</span><span>Hello world!</span></div>

I guess this doesn’t seem like much of an accomplishment, but it’s a huge first step towards being able to do actual JS-based server-side web development under AOLserver.

I want to iron out a strange crash bug when the JS interp. is destroyed via [js destroy], and complete the file I/O stub that isn’t finished yet, then check in nsjsapi.js. I plan to get this done in time for my talk at jQueryCamp07 this weekend.

Tags: , , ,

Running AOLserver … on the iPhone?

Tuesday, October 16th, 2007

Apparently Eric O’Laughlen has managed to compile AOLserver for the iPhone. Then, he went and forked the code into what he’s calling “Joggame Server“. (If you thought “AOLserver” was a bad name, it’s nothing compared to that!)

I haven’t jumped on the iPhone bandwagon, sticking with my old Treo 650 for now, but this makes me wish I had access to one. Running web applications locally on the iPhone opens the door to applications that are usable online as well as offline. Of course, someone has to write such applications, first, which remains to be seen.

Still, maybe this will help get some new folks interested in AOLserver and that can only be a good thing!

Tags: ,

Enough of the politics, on with the geeking!

Thursday, September 27th, 2007

Okay, I’m sorry I indulged myself the last few days with the spurt of political blogging. I’ve gotten it out of my system now. Time to get back to the hardcore geeking!

Here’s a short list of things that are either on my mind or somewhere in my to-do list:

  • Commit my changes to AOLserver to build easily with MinGW/MSYS on Win32. I even put together a quick NSIS script, so there’s a nice one-click installer for AOLserver 4.0.10 on Win32, now.
  • Commit my changes to Gnash to build and link correctly using MinGW/MSYS on Win32. No fancy installer, but here’s my previous blog post about it.
  • Do some more work on nsjsapi, the AOLserver module to integrate Mozilla SpiderMonkey into AOLserver for server-side JavaScript. I’d like to get it working well enough to load and use jQuery so I can show it off at jQueryCamp07 this October.
  • Work with the community to put together a list of “Top 5 Goals” for AOLserver, then assemble a real plan to get those things done. A big bonus would be if I didn’t have to do everything myself.
  • Find someone who wants to check out Gobby with me. It’s a free, open source, multi-platform, collaborative real-time file editing application with chat and syntax highlighting. Think: World of Notepad. Could be a nice way to do remote paired programming with two or more people. Or, a good way to do code reviews with a geographically distributed team.

If you’d like to hear more about any of these things–or better yet, do them together with me, let me know!

64-bit AOLserver on Debian 4.0 (etch) Linux works

Sunday, September 23rd, 2007

John Buckman pointed out in this thread that AOLserver wasn’t working right on his 64-bit Linux box that he wants to upgrade BookMooch to. I offered to help, but pointed out that I don’t have a machine to test on–so, he graciously provided me temporary access to one of his machines to diagnose the problem.

After some poking and prodding, I believe the correct change to get AOLserver to build is to edit include/ns.mak on line 79, after running configure which generates it from ns.mak.in. Change the line from:

LDLIB           = ${CC} -shared ${CFLAGS} ${LDFLAGS}

to:

LDLIB           = ${CC} -nostartfiles -shared ${CFLAGS} ${LDFLAGS}

Simply add the “-nostartfiles” after “${CC}” in the LDLIB variable. I reported this to the AOLserver mailing list as well.

John confirms that he’s now able to run AOLserver on his luscious new 64-bit 2-CPU Xeon E5335 Clovertown quad-core box.

In return, I asked John to do me a favor and perform a simple benchmark, fetching a 4K static file from AOLserver using ApacheBench, and here’s what you might be able to expect:

# ab -c 50 -n 50000 http://.../x.txt
...
Server Software:        AOLserver/4.5.0
Server Hostname:        ...
Server Port:            80

Document Path:          /x.txt
Document Length:        4070 bytes

Concurrency Level:      50
Time taken for tests:   3.281485 seconds
Complete requests:      50000
Failed requests:        0
Write errors:           0
Total transferred:      217654353 bytes
HTML transferred:       203504070 bytes
Requests per second:    15237.00 [#/sec] (mean)
Time per request:       3.281 [ms] (mean)
Time per request:       0.066 [ms] (mean, across all concurrent requests)
Transfer rate:          64773.42 [Kbytes/sec] received

No, that’s not a typo: 15,237 requests per second. This is without any tuning or tweaking of the IP stack or anything. Of course, 15K req/sec at 4K per request is ~218MB–over a span of 3.2 seconds is effectively 544 Mbps, so you’re more likely to run out of upstream network bandwidth than run out of horsepower serving static assets out of AOLserver on this kind of hardware.

Naturally, you shouldn’t epxect this kind of throughput on dynamic requests and benchmarking those isn’t really meaningful since the nature of your application code will greatly affect the request execution time. However, it’d be fun to do a “web server shootout” where each implements a trivial piece of dynamic functionality in their best environment–Apache with mod_perl, mod_python, FastCGI/PHP, etc. vs. AOLserver with Tcl–and see which one has the least amount of overhead.

Still, it’s great news that John’s BookMooch service is going to be able to move to a beefy 64-bit box, and I’m very glad to know that 64-bit AOLserver does run just fine for at least one application on Debian Linux.

Tags: , , , ,

AOLserver 4.0.10 on Win32 with NSIS installer

Friday, June 15th, 2007

The downside of working for companies under confidentiality agreements is that I can’t openly talk about the cool stuff I’m doing all day long, but I still find an hour or two on the weekends to work on AOLserver, which I can talk about all I want.

The latest itch I’ve started scratching is getting AOLserver to build on the Win32 platform using the free and open source toolchain MSYS/MinGW. It’s part of an effort I’ve wanted to complete for a long time: to create a “batteries included” distribution of AOLserver that’s easy to install and get started on. I’ve packaged the build using NSIS, the Nullsoft Scriptable Install System, which provides the familiar Windows application installer (and uninstaller!) that many people are familiar with. In other words, getting started with AOLserver on Win32 couldn’t get any easier.

In these early builds, I’ve included:

  • AOLserver 4.0.10
    • nsmysql
    • nssqlite3
  • Tcl 8.4.15
  • Zlib 1.2.3
  • SQLite 3.3.17
  • MySQL Client 5.0.27

I hope to add the AOLserver nsopenssl (for HTTPS/SSL support) and nsodbc (to connect to any Win32 ODBC database) modules as well. I may include support for PHP 5, depending on how much effort that entails.

One big wishlist item that I’d appreciate help with is including some documentation with the installer. Jamie Rasmussen started working on packaging the existing docs up as .CHM files, which is the format used by Microsoft’s HTML Help Workshop (FAQ). I’d like to finally finish updating and cleaning up the docs we have and including it with the installer as a .CHM, too.

If you’d like to download an interim build, here’s 4.0.10-2 for your experimental pleasure:

Once I’m comfortable with the installer package, I’ll be committing my changes to CVS along with documentation on how to produce the build. Then, I’ll try to create another installer using AOLserver 4.5.

If you have bug reports, comments or feedback about the installer, go ahead and leave them in the comments below. Thanks!

Tags: , , , , ,



Warning: sem_acquire(): supplied argument is not a valid SysV semaphore resource in /home/dossy/htdocs/wp/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 107

Warning: sem_release(): supplied argument is not a valid SysV semaphore resource in /home/dossy/htdocs/wp/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 116