Future of the Ribbon library, performance of asp.net, and more…

3 02 2008


It has been a long time since my last post, but I have had an exam period of 6 weeks. I will be free monday ๐Ÿ˜€

Regarding the Ribbon Sharp library, we are trying to distinguih ourself from other vendors. In addition, we would like to find a new name for the project. So if you have a nice idea, post it as a comment!!

Regarding the development, it is now possible to place the title of a group at the left, right, or top in addition to the original bottom position. Personally, I think that the left position is great because it helps make the overall bar thinner (and we tend to have wide screens nowadays). You can see the result below:


As you can see, the expansion button take a lot of space in such a layout. I think we should put it at the opposite side of the group whenever the title is placed at the left or right. I have also tried to understand how key bindings work with Gtk#. As far as I have understood, I had to give a name for the signals that can be activated through a key. Consequently, I did so for most functionalities of the library. But I have not tested that part yet.

The great news is that Paweล‚ ‘X4lldux’ Drygas got the library to work under Windows, and fixed a few bugs. I should get its patch soon.

Of course you may wonder why I have been so long, or why I have not produced more code in such a long period! The answer is that I have also produced 5000 lines of C# for my own, new, object database. I find that project much more challenging and fun to hack. It should be out for the summer. In addition, I will develop for the Android challenge during February.

Finally, I recently quit my asp.net hoster due to bad service. I’m now at linode, and had to use Mono to host the web site. Consequently, I did a few benchmark to test performance and stability. The objective of the benchmark is to test the memory leaks, and responsiveness. Consequently, the page is a webhandler (.ashx), that writes back “Hello Word” followed by the Http Host specified by the request object. Here are the results:

In an InnoBox Virtual Machine running on my Intel E6400, using ab -c 100 -n 50000 (100 concurrent connections, 50000 requests) :

  • fastcgi-mono-server2 /socket=unix /multiplex=True, using nginx
    RSS=290MB, 175 req/s, 33 failed requests
  • fastcgi-mono-server2 /socket=tcp /multiplex=True, using nginx
    RSS=274MB, 161 req/s, 296 failed requests
  • xsp2
    RSS=25.5MB, 373 req/s, 0 failed requests

Cleary fastcgi has memory leaks, and performance troubles. Of course, fastcgi is still young.

And now on my Intel Pentium 4 2.7 Ghz:

  • mod_mono2
    372 req/s, 0 failed, 2.242 MiB transfered
  • xsp2
    465 req/s, 0 failed, 1.714 MiB transfered
  • nginx+mod_wsgi (python)
    3610 req/s, 0 failed, 1.7 MiB transfered

Conclusion? We should try to throw the asp.net stack out of the window first, and modify the code of mod_wsgi to host mono instead of python, calling a simple method similar to wsgi. If the performance is on par with python, we could then bind that to the asp.net, and check performance. mod_wsgi is released under the MIT license, so no trouble there. For now, I use nginx which proxifies requests to asmx, ashx, and aspx files to an xsp2 server.

Wow, I do not blog often, but when do, it is worth a thousand pages.

EDIT: The problem with nginx+mod_wsgi is that it is not multi threaded, but multi process. It is likely due to the fact that nginx is event-based.





14 responses

3 02 2008

How come nginx+mod_wsgi transfers roughly the same amount of data while handling 10x the request number/s?

Wouldn’t that suggest that the data volume is incomparable between the two?

Just my 2 cents, maybe this topic is indeed worth a page or 2 more, because, the results shown are just a bit dense for me to interpret.

i love that some people are doing this kind of profiling by the way! It’ll mean I can start hosting my apps in mono soon ๐Ÿ™‚


3 02 2008

I have written the transfered volumes to avoid comments such as : “yeah but maybe that server X sends twice as much data as Y”. It is clear that the size of responses are roughly the same. Consequently, yes python is 10x faster to produce the same amount of data. But the objective is more about latency measurement. If your page require 50ms of processing, nginx+mod_wsgi will fail miserably. Indeed, 4 worker processes, waiting 50 ms (for I/O) for each response, will to 1/0.05 = 20 req/s. Since there are 4 workers, we get 80 req/s. Thanks to its thread pool, XSP would shine in such a situation.

It also remind me an old interesting idea. Our problem is that a thread becomes ‘useless’ when it sleeps for I/O. It would be interesting to replace each synchronous read or write operation, by an async one followed by an exception creation containing the event ID. The exception would be catched by the web server, which would be the client in a waiting list. As soon as the data is ready (we can know this using the event ID), the web server could continue the execution of the client if the language supports exception recovering. Of course, it sounds a lot like a scheduler, and it would nice implement a scheduler once and for all. But, the concept would be interesting nonetheless, at least to study the impact with 10 000 concurrent connections.

3 02 2008

It is quite funny that you say that my post is so dense, because my teacher told me the same about my master thesis last year.

3 02 2008

Thanks for clarifying. I now understand the obvious ๐Ÿ™‚ all benchmarks perform the same total number of requests, which is why (of course) the total amounts of data transferred have to add up.

As a sidenote to your sidenote on perhaps scheduling request across a thread pool in case of IO-waits… my intuition is that it could be a very bad idea to use exceptions to do ‘IPC’ (inter-thread comm.?). Basically, it seems a *lot* cheaper to just kill a thread than to have it unwind the stack. I have found that exceptions frequently became performance bottlenecks on high-traffic websites in ASP.NET 1.1 on IIS 6. Obviously, mono could be different, but it sure calls for a li’ll bit of profiling before jumping into any pool scheduler designs?

Keep it up with the writing. I kind-a like the fact that every sentence contains a nugget of information.

3 02 2008

(why the hell do I always forget to write my ideas in a complete way) Of course I meant fast, efficient exceptions, with resuming/recovering support. In .NET, exception are a last resort option, only used for programmatic errors. It was more an academic idea, than an idea for a next project ๐Ÿ˜€ My real plan is just to embed mono inside nginx if it is possible to use thread pool inside nginx. Indeed, nginx has the infrastructure for threads, but do not implement it as far as I know. In any case, my database project is more important in my TODO list; because the performance of XSP is ok for most usages.

3 02 2008

Call it “tabbed toolbars”; that way, it’s clear that it’s a combination of standard UI elements. I think part of the motivation for Microsoft to adopt “ribbons” was to have a UI element that they could assert ownership over; I wouldn’t be surprised if they sued over this. Ribbons also have a number of other undesirable properties.

If you want a ribbon-like UI element without the risk of infringing, why not use something like the Impress sidebar in OpenOffice? It also consists of different panels containing selections related to the current document, and given our widescreen displays, a vertical element is probably better anyway.

In no case would I get rid of the menu bar. A simple, well-organized menu bar is enormously useful.

3 02 2008

The objective is to enhance the tool bar concept. Now you could take the groups and put them in a side bar, top-down. I could be a clever idea if you work with portrait document (i.e. you want as must height as possible to display the page, while border are unused).

About replacing the menu bar, I’m mixed. I have written an hundred pages using Word 2007, and I never missed the menu bar, and my document was not trivial, it was full of equations, styling, citations, table of contents, etc. But the objective with our library was to allow the developer to offer a menu bar, at the left of tabs (i.e. taking less space). Of course, if we put groups in a side bar, the tabs would have to move to the side bar as well, leaving the menu bar lonely.

4 02 2008

Tabbed Toolbars is ok, but I would find it strange to write ‘TabbedButton’, ‘TabbedGroup’ and so on.

Yesterday, at night, I got two ideas: ConciseBar, or CandyBar.

Concise: try to put many concepts, options, in a few space, but in a comprehensive manner.

Candy: the objective is to have something nice for the end-user, and desirable to use for developers. In addition, the library would have a cool name I think :p

22 02 2008

The first case seems disappointing for Python. Was database involved in your app? Here is what I get from running PHP Hello World on a 128MB VPS:

Document Path: /t1.php
Document Length: 10 bytes

Concurrency Level: 100
Time taken for tests: 36.694599 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Total transferred: 7850157 bytes
HTML transferred: 500010 bytes
Requests per second: 1362.60 [#/sec] (mean)
Time per request: 73.389 [ms] (mean)
Time per request: 0.734 [ms] (mean, across all concurrent requests)
Transfer rate: 208.91 [Kbytes/sec] received

22 02 2008

It was a simple hello world, which was reading a request variable. The delay was simulated by a sleep. Your comparison is not really relevant, because you do not necessarily have the same hardware than mine, and it is a VPS. Indeed in a VPS, you never know whan someone else is using the machine.

3 06 2008

>Regarding the development, it is now possible to place the title of a group at
>the left, right, or top in addition to the original bottom position. Personally, I
>think that the left position is great because it helps make the overall bar thinner
>(and we tend to have wide screens nowadays). You can see the result below:

Please Laurent, never ever display western text vertically like that. My eyes!!!

10 09 2008

You compared a small slice of a linode host to a standalone box? At least use the same system. I’d wager that something isnt setup right if you are getting so many dropped requests. What lighttpd did you use? I’d be interested in seeing your lighttpd’s fastcgi setup.

10 09 2008

ERr nginx not lighttpd. Still your results are scaring me.

10 09 2008

As it was told in the post, linode is my web hoster, but the benchmarks have been run in Innotek which has nothing to do with a linode. It was just a VM on a desktop computer (note: linode uses Xen and UML).

Some purists would never run benchmarks in a VM, even if everything else is idle, but that was quick & fast for me, and virtualization becomes the norm for the server space.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: