* Re: [Caml-list] Re: scalable web apps
@ 2010-07-26 13:45 Dario Teixeira
0 siblings, 0 replies; 4+ messages in thread
From: Dario Teixeira @ 2010-07-26 13:45 UTC (permalink / raw)
To: Sylvain Le Gall, William Le Ferrand; +Cc: caml-list
Hi,
> Why would you use ocsigen to serve static files?
Simplicity. A single server takes care of dynamic and static content,
making it easy to develop and administer.
> For corefarm.com we put all the files in amazon s3 and we just generate
> on the fly the url to retrieve them (adding the timestamp, signing the
> get parameters etc).
Yes, S3 is awesome, but I reckon it would be overkill for what Sylvain has
in mind. Moreover, it does represent an extra -- albeit small -- cost.
Cheers,
Dario Teixeira
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] scalable web apps
@ 2010-07-26 11:20 Dario Teixeira
2010-07-26 16:50 ` Florent Monnier
0 siblings, 1 reply; 4+ messages in thread
From: Dario Teixeira @ 2010-07-26 11:20 UTC (permalink / raw)
To: Joel Reymont, Richard Jones; +Cc: caml-list
Hi,
> > How does Ocsigen handle database operations?
>
> I thought it was using PG'OCaml, but maybe I'm wrong.
Ocsigen itself does not use PG'OCaml. The two are frequently associated
because the latest versions of PG'OCaml are Lwt-friendly and therefore
a good choice for Ocsigen apps. (Note that internally, Ocsigen uses
either Dbm or Sqlite to store session data).
Cheers,
Dario Teixeira
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] scalable web apps
2010-07-26 11:20 [Caml-list] " Dario Teixeira
@ 2010-07-26 16:50 ` Florent Monnier
2010-07-26 17:10 ` Sylvain Le Gall
0 siblings, 1 reply; 4+ messages in thread
From: Florent Monnier @ 2010-07-26 16:50 UTC (permalink / raw)
To: caml-list
Le lundi 26 juillet 2010 13:20:46, Dario Teixeira a écrit :
> Hi,
>
> > > How does Ocsigen handle database operations?
> >
> > I thought it was using PG'OCaml, but maybe I'm wrong.
>
> Ocsigen itself does not use PG'OCaml. The two are frequently associated
> because the latest versions of PG'OCaml are Lwt-friendly and therefore
> a good choice for Ocsigen apps. (Note that internally, Ocsigen uses
> either Dbm or Sqlite to store session data).
Both Dbm and Sqlite lock the entire files which blocks concurrent uses,
isn't it a problem?
--
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: scalable web apps
2010-07-26 16:50 ` Florent Monnier
@ 2010-07-26 17:10 ` Sylvain Le Gall
2010-07-26 17:21 ` [Caml-list] " Gabriel Kerneis
0 siblings, 1 reply; 4+ messages in thread
From: Sylvain Le Gall @ 2010-07-26 17:10 UTC (permalink / raw)
To: caml-list
On 26-07-2010, Florent Monnier <monnier.florent@gmail.com> wrote:
> Le lundi 26 juillet 2010 13:20:46, Dario Teixeira a écrit :
>> Hi,
>>
>> > > How does Ocsigen handle database operations?
>> >
>> > I thought it was using PG'OCaml, but maybe I'm wrong.
>>
>> Ocsigen itself does not use PG'OCaml. The two are frequently associated
>> because the latest versions of PG'OCaml are Lwt-friendly and therefore
>> a good choice for Ocsigen apps. (Note that internally, Ocsigen uses
>> either Dbm or Sqlite to store session data).
>
> Both Dbm and Sqlite lock the entire files which blocks concurrent uses,
> isn't it a problem?
>
For sqlite, at least, it uses Lwt_preemptive.detach and sqlite3 contains
the required caml_enter/leave_blocking_section(s). So Lwt should work
without problems with sqlite.
I suppose it is the same for dbm.
Regards,
Sylvain Le Gall
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] Re: scalable web apps
2010-07-26 17:10 ` Sylvain Le Gall
@ 2010-07-26 17:21 ` Gabriel Kerneis
0 siblings, 0 replies; 4+ messages in thread
From: Gabriel Kerneis @ 2010-07-26 17:21 UTC (permalink / raw)
To: Sylvain Le Gall; +Cc: caml-list
On Mon, Jul 26, 2010 at 05:10:01PM +0000, Sylvain Le Gall wrote:
> > Both Dbm and Sqlite lock the entire files which blocks concurrent uses,
> > isn't it a problem?
>
> For sqlite, at least, it uses Lwt_preemptive.detach and sqlite3 contains
> the required caml_enter/leave_blocking_section(s). So Lwt should work
> without problems with sqlite.
>
> I suppose it is the same for dbm.
No. For dbm there is a separate daemon (ocsidbm) opening the file once
and serializing requests sent from and back to Ocsigen through a pipe.
Regards,
--
Gabriel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: scalable web apps
@ 2010-07-26 9:11 Sylvain Le Gall
2010-07-26 11:10 ` [Caml-list] " Dario Teixeira
0 siblings, 1 reply; 4+ messages in thread
From: Sylvain Le Gall @ 2010-07-26 9:11 UTC (permalink / raw)
To: caml-list
Hello,
On 25-07-2010, Dario Teixeira <darioteixeira@yahoo.com> wrote:
>
> The only circumstance where I would be cautious on relying solely on a
> naked Ocsigen is if you are also required to serve plenty of static content
> (images, etc). Even though Ocsigen includes an extension for serving static
> pages, for hysterical reasons no Unix supports non-blocking mode for regular
> files, which of course causes problems for Lwt-apps (see the Lwt manual for
> more information on this). Therefore, in this context you may get better
> results by having another server (like Nginx) dedicated to static content.
>
I am creating an application with ocsigen that requires to serve a lot
of .tar.gz as static contents.
Do you think the "no Unix supports non-blocking mode" will cause problem
in this case?
Regards,
Sylvain Le Gall
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] Re: scalable web apps
2010-07-26 9:11 Sylvain Le Gall
@ 2010-07-26 11:10 ` Dario Teixeira
2010-07-26 12:58 ` Sylvain Le Gall
0 siblings, 1 reply; 4+ messages in thread
From: Dario Teixeira @ 2010-07-26 11:10 UTC (permalink / raw)
To: caml-list, Sylvain Le Gall
Hi,
> I am creating an application with ocsigen that requires to serve a lot
> of .tar.gz as static contents.
>
> Do you think the "no Unix supports non-blocking mode" will cause problem
> in this case?
I presume that application is related to the Oasis-DB initiative, right?
I wouldn't worry too much in that case. First, because the Ocaml community
is not that big (yet) as to cause such heavy traffic. Second, because
the set of tar.gz files is not that great (a few hundred, max?) and those
files will tend to be small. If your server has enough memory, there's a
good chance many of the file blocks requested will eventually be buffered
in memory by the kernel, thus minimising expensive disc I/O.
Cheers,
Dario Teixeira
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: scalable web apps
2010-07-26 11:10 ` [Caml-list] " Dario Teixeira
@ 2010-07-26 12:58 ` Sylvain Le Gall
2010-07-26 13:20 ` [Caml-list] " William Le Ferrand
0 siblings, 1 reply; 4+ messages in thread
From: Sylvain Le Gall @ 2010-07-26 12:58 UTC (permalink / raw)
To: caml-list
On 26-07-2010, Dario Teixeira <darioteixeira@yahoo.com> wrote:
> Hi,
>
>> I am creating an application with ocsigen that requires to serve a lot
>> of .tar.gz as static contents.
>>
>> Do you think the "no Unix supports non-blocking mode" will cause problem
>> in this case?
>
> I presume that application is related to the Oasis-DB initiative, right?
You guess right ;-)
> I wouldn't worry too much in that case. First, because the Ocaml community
> is not that big (yet) as to cause such heavy traffic. Second, because
> the set of tar.gz files is not that great (a few hundred, max?) and those
> files will tend to be small. If your server has enough memory, there's a
> good chance many of the file blocks requested will eventually be buffered
> in memory by the kernel, thus minimising expensive disc I/O.
>
There is indeed a good chance that the files end up in memory.
Thank you for your remarks.
Regards,
Sylvain Le Gall
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] Re: scalable web apps
2010-07-26 12:58 ` Sylvain Le Gall
@ 2010-07-26 13:20 ` William Le Ferrand
0 siblings, 0 replies; 4+ messages in thread
From: William Le Ferrand @ 2010-07-26 13:20 UTC (permalink / raw)
To: Sylvain Le Gall; +Cc: caml-list
[-- Attachment #1: Type: text/plain, Size: 1782 bytes --]
Why would you use ocsigen to serve static files?
For corefarm.com we put all the files in amazon s3 and we just generate on
the fly the url to retrieve them (adding the timestamp, signing the get
parameters etc).
My 2 cents,
william
2010/7/26 Sylvain Le Gall <sylvain@le-gall.net>
> On 26-07-2010, Dario Teixeira <darioteixeira@yahoo.com> wrote:
> > Hi,
> >
> >> I am creating an application with ocsigen that requires to serve a lot
> >> of .tar.gz as static contents.
> >>
> >> Do you think the "no Unix supports non-blocking mode" will cause problem
> >> in this case?
> >
> > I presume that application is related to the Oasis-DB initiative, right?
>
> You guess right ;-)
>
> > I wouldn't worry too much in that case. First, because the Ocaml
> community
> > is not that big (yet) as to cause such heavy traffic. Second, because
> > the set of tar.gz files is not that great (a few hundred, max?) and those
> > files will tend to be small. If your server has enough memory, there's a
> > good chance many of the file blocks requested will eventually be buffered
> > in memory by the kernel, thus minimising expensive disc I/O.
> >
>
> There is indeed a good chance that the files end up in memory.
>
> Thank you for your remarks.
>
> Regards,
> Sylvain Le Gall
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
--
William Le Ferrand
Speed matters : http://www.corefarm.com
Objects get social : http://www.sotokolan.com
Mobile : +33 6 84 01 52 92
LinkedIn : http://www.linkedin.com/in/williamleferrand
[-- Attachment #2: Type: text/html, Size: 2910 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-07-26 17:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-26 13:45 [Caml-list] Re: scalable web apps Dario Teixeira
-- strict thread matches above, loose matches on Subject: below --
2010-07-26 11:20 [Caml-list] " Dario Teixeira
2010-07-26 16:50 ` Florent Monnier
2010-07-26 17:10 ` Sylvain Le Gall
2010-07-26 17:21 ` [Caml-list] " Gabriel Kerneis
2010-07-26 9:11 Sylvain Le Gall
2010-07-26 11:10 ` [Caml-list] " Dario Teixeira
2010-07-26 12:58 ` Sylvain Le Gall
2010-07-26 13:20 ` [Caml-list] " William Le Ferrand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox