www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - web development in D programming

reply bioinfornatics <bioinfornatics fedoraproject.rog> writes:
Dear,
After read this thread:
http://www.digitalmars.com/d/archives/digitalmars/D/learn/Web_Development_2=
7414.html
and this one:
http://www.digitalmars.com/d/archives/digitalmars/D/learn/How_To_Dynamic_We=
b_Rendering_26770.html

I am a little disapointed, so if you have many request for a web page
this lib  http://arsdnet.net/dcode/ is usable or not ?

If they are any other method to do a web application in D2 programming
do not hesitate and tell to me which lib used.

Thanks

Kind regards
Nov 08 2011
next sibling parent reply Dejan Lekic <dejan.lekic gmail.com> writes:
bioinfornatics wrote:

 
 I am a little disapointed, so if you have many request for a web page
 this lib  http://arsdnet.net/dcode/ is usable or not ?
 
I am developing an implementation of the FastCGI protocol (http://www.fastcgi.com) in D2 with the main goal go have multiplexing support. However the development is slow due to the lack of time. I believe a good http server implementation would be appreciated by the community, but FastCGI server will make it possible to create a highly- scalable web applications using some of the well-known web servers (I use Lighttpd for an example). Your code is usable, but not production-ready.
Nov 09 2011
next sibling parent simendsjo <simendsjo gmail.com> writes:
On 09.11.2011 12:58, Dejan Lekic wrote:
 bioinfornatics wrote:

 I am a little disapointed, so if you have many request for a web page
 this lib  http://arsdnet.net/dcode/ is usable or not ?
I am developing an implementation of the FastCGI protocol (http://www.fastcgi.com) in D2 with the main goal go have multiplexing support. However the development is slow due to the lack of time. I believe a good http server implementation would be appreciated by the community, but FastCGI server will make it possible to create a highly- scalable web applications using some of the well-known web servers (I use Lighttpd for an example). Your code is usable, but not production-ready.
Does Lighttpd and nginx support multiplexing? I couldn't get them to multiplex in my tests.
Nov 09 2011
prev sibling next sibling parent Andrea Fontana <advmail katamail.com> writes:
SCGI is a lot easier to implement than FASTCGI and is well-supported too
from webservers.
I've just developed a  SCGI  web-service in D over lighttpd.


Il giorno mer, 09/11/2011 alle 11.58 +0000, Dejan Lekic ha scritto:

 bioinfornatics wrote:
=20
=20
 I am a little disapointed, so if you have many request for a web page
 this lib  http://arsdnet.net/dcode/ is usable or not ?
=20
=20 I am developing an implementation of the FastCGI protocol=20 (http://www.fastcgi.com) in D2 with the main goal go have multiplexing=
=20
 support. However the development is slow due to the lack of time.
=20
 I believe a good http server implementation would be appreciated by the=
=20
 community, but FastCGI server will make it possible to create a highly-
 scalable web applications using some of the well-known web servers (I use=
=20
 Lighttpd for an example).
=20
 Your code is usable, but not production-ready.
=20
Nov 09 2011
prev sibling next sibling parent Adam Ruppe <destructionator gmail.com> writes:
Dejan Lekic wrote:
 Your code is usable, but not production-ready.
What is lacking there that you need? I know a few parts of it aren't ideal, but I haven't found them to be big problems in practice (which is why I haven't changed it yet!)
Nov 09 2011
prev sibling parent Kapps <Kapps NotValidEmail.com> writes:
Speaking only for lighttpd, it didn't work too well for me when I tried 
it (using FCGI). First off, it does not seem to support multiplexing. As 
well as that, it had no way I could figure out for handling concurrent 
requests.

So, the way every single request goes is:
Lighttpd opens a connection with your FCGI handler.
Lighttpd sends a request.
You receive the request.
You handle the request.
You send a response.
Lighttpd closes the connection, and sends the user the response.
Lighttpd opens a new connection and sends the next request.

Overall, it was quite bad performance (it's of course possible that I 
was doing something wrong, but many hours of googling and testing could 
not figure out a solution). My basic test gave me about 75 requests / 
second on my test machine. I ended up writing my own server, which, in 
comparison to the 75 page loads per second or so I got with lighttpd, 
gives me around 1000. The difference is that mine supports concurrent 
requests, instantiating an instance of each Page per thread, and 
directly calls the D code instead of sending a request over the network 
/ to a different process (this is something that will need to have the 
option of being changed though, to support multiple servers, and change 
a dynamic page without shutting down the whole server to recompile). The 
server is not ready for release yet though, and is just an example to 
demonstrate inefficiencies/scaling in lighttpd for FCGI. It works well 
for PHP AFAIK, but I think it handles that directly with a plugin. It 
would also be possible to write such a plugin for D, and is likely a 
better alternative than making your own server.

I think lighttpd 2.0 may fix some of these issues though, including 
concurrency, and provides a new protocol that sends the Http requests 
directly. If so, that would likely be a good thing to use.

I also think Apache doesn't support multiplexing or concurrent requests, 
but this is something I could very likely be wrong on.

On 09/11/2011 5:58 AM, Dejan Lekic wrote:
 bioinfornatics wrote:

 I am a little disapointed, so if you have many request for a web page
 this lib  http://arsdnet.net/dcode/ is usable or not ?
I am developing an implementation of the FastCGI protocol (http://www.fastcgi.com) in D2 with the main goal go have multiplexing support. However the development is slow due to the lack of time. I believe a good http server implementation would be appreciated by the community, but FastCGI server will make it possible to create a highly- scalable web applications using some of the well-known web servers (I use Lighttpd for an example). Your code is usable, but not production-ready.
Nov 10 2011
prev sibling next sibling parent Trass3r <un known.com> writes:
 I am a little disapointed, so if you have many request for a web page
 this lib  http://arsdnet.net/dcode/ is usable or not ?

 If they are any other method to do a web application in D2 programming
 do not hesitate and tell to me which lib used.
There's also a project named Serenity http://www.digitalmars.com/d/archives/digitalmars/D/Serenity_web_framework_-_early_feedback_wanted_125473.html But it hasn't been updated in months nor is it mature. Adam uses his code in production and also provides FastCGI support.
Nov 09 2011
prev sibling next sibling parent Adam Ruppe <destructionator gmail.com> writes:
Note that the new location for my code is on github:

https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff


What disappointed you, by the way?
Nov 09 2011
prev sibling parent Andrew Gough <andrew goughy.org> writes:
On Wed, 09 Nov 2011 03:22:37 +0100
bioinfornatics <bioinfornatics fedoraproject.rog> wrote:

 Dear,
 After read this thread:
 http://www.digitalmars.com/d/archives/digitalmars/D/learn/Web_Development_27414.html
 and this one:
 http://www.digitalmars.com/d/archives/digitalmars/D/learn/How_To_Dynamic_Web_Rendering_26770.html
 
 I am a little disapointed, so if you have many request for a web page
 this lib  http://arsdnet.net/dcode/ is usable or not ?
 
 If they are any other method to do a web application in D2 programming
 do not hesitate and tell to me which lib used.
 
 Thanks
 
 Kind regards
 
I don't know if you're interested, but I just uploaded a bare bones HTTP implementation to https://github.com/goughy/d/http4d Its very bare bones, but allows embedded processing of HTTP requests both synchronously and asynchronously, although there is no mechanism for routing - that's left up to the implementer. There is more work to do around large posts (eg file uploads) and supporting chunked outbound transfers, but its usable. I'd appreciate some feedback if you have time. -- Andrew Gough M: 0408 596 656 andrew goughy.org
Nov 26 2011