• 0

[C#] Webserver


Question

I'm developing a webserver for a pass time.

It currently can serve simple files (HTML, JPG and GIF). It's written in C# and thus needs the .NET framework to run. It's pretty alpha, so no special features yet.

Currently most parameters are hardcoded, it runs up to 36 threads (32 for requests and the another 4 on request to handle Server Overload notices). The files to be served to into the Files subfolder from where it is started. The port is port 80 and also hardcoded atm.

http://www.tomservo.cc/ionic/files/ionic.zip

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

Cool, I've not got .net yet so there's no point downloading. But how do you see it progressing and what are these special features ;)

is ASP something you'd add in future (I've no idea how you'd do that :p )?

Link to comment
Share on other sites

  • 0

you know what you need to do (for the sake of neowin here) is code a forum into their. A hardcoded, compiled forum program would kick EVERY OTHER FORUMS ASS! Think about it, you'd rule the world :D Just gotta get it to run on linux ;)

Link to comment
Share on other sites

  • 0

Ok, I found a stupid stress tool, but it allows only 5 threads, prolly because it's eval. But I get 250 hits/sec on it, where as IIS6 does 300hits/sec.

That's already pretty good, but when I'm going to implement virtual paths and all, I think performance will drop. But then again, my threading scheme is crap atm too. :D

Link to comment
Share on other sites

  • 0

Hrm, OK. I never wrote a forum software yet, and I will regret trying this because I think it is a pain in the ass, but...

Anyone would need this?

Because not only the forum software itself is a pain in the ass, but since noone can afford SQL Server, it'd need to write a half-assed database engine too!

...

Ah whatever, I'll just try it. I will fork the source tree now.

Link to comment
Share on other sites

  • 0

don't use SQL server! that's the whole point to coding it yourself, you don't have to worry about coding SQL stuff or the like. Just use a file-based database and it'll be a helluva lot faster than most things our there :D

Link to comment
Share on other sites

  • 0

Just store everything in memory and sometimes make backups... that should speed some things up. But of course I don't know if this is really possible.

You could just create objects in memory and sometimes use this serialization to dump it to disk. Of course you need some access paths like AVL/binary trees for fast access to all infos. Biger files would be memory objects to, but they would be read from files.

If I think of it, its probably quite possible to build a nice solution. Just think a little bit about the design before.

I even could eventually try to help. (but not in the next 4 weeks, as I'll be on vacation)

Another thought: these databases where developed when <1 MB Ram where available. Today I think other designs could work as well or even better. The big feature of the databases is the possibility to ask questions like "give me all entries which have this and this"... you'll need some similar design inside the app.

Link to comment
Share on other sites

  • 0
Currently most parameters are hardcoded, it runs up to 36 threads (32 for requests and the another 4 on request to handle Server Overload notices).
Did you ever think about using a thread pooling design using completion ports? Task switching is pretty expensive on a non-SMP machine, especially when you use 32 threads just for requests. With completion ports, you can handle the same amount of traffic (probably more) with only 2 threads handling requests.
Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.