Hi Neil,

With persistent connections have a look at my code here:
https://github.com/matiu2/witty-plus/tree/master/base-app/lib

This class handles the setting and getting of the cookies:
https://github.com/matiu2/witty-plus/blob/master/base-app/lib/SessionHandle.hpp

I use an in memory map of cookie to session info:
https://github.com/matiu2/witty-plus/blob/master/base-app/lib/MemorySessionStore.hpp

But it should be a lot easier to write a DB stored map, as you woudn't have
to worry about being hit by multiple threads.

----

2nd question and 3rd questions:

I deploy my app running as root without being behind any webservers or
anything .. it has a single process, but is multi threaded. hitting the 3
urls it has now with seige at 1000 concurrent users for 2 minutes, it does
about 648 req/sec on a cheapo 256 MB of RAM VPS. It sits at about 12 MB when
idle and gets up to about 38 MB when being seiged.

when I had it deployed behind nginx and fcgi .. I had it compiled with most
of the worky bits in .so (dll) files and a really skinny stub of an
executable .. so that most of the code/memory would be shared between the
processes.

Good luck :)

Matthew Sherborne



On Thu, Sep 8, 2011 at 3:00 AM, Neil D'Souza <[email protected]> wrote:

> Dear All,
>
>      I am developing a witty web app, open source. It compiles surveys to
> c++ and uses the Wt for web.
>
>      One of the problems I will face in the near future is:
>
>      we send out links to users to take a survey. Wt creates a session.
> Now, maybe due to a programming bug, the survey needs to be taken down,
> recompiled and restarted. The old session information is lost and the user
> may have to retake the survey from scratch. Currently what I am doing is
> using sessionId() call to save the session in map and load the appropriate
> survey when the user comes in. However when the app restarts, i want to be
> able to persist this data to disk and have Wt reload this information if it
> is present in a special file, or a file passed as an option to wt. This way
> I will be able to load the survey status appropriately. I can use a custom
> signal to trigger the app to save the data to disk, or save it one at a
> time, when sessions are created.
>
>       How do I do this with Wt?
>
>       2nd question:
>
>      I ran my test survey and found it to be using 4 Mb of ram - valgrind
> numbers. I then ran the hello world application and found it to be using
> about 3 Mb - so my code is using the remaining 1 Mb. Also I hit the server
> for parallel connections - and each session is using 4 Mb. If I have many
> sessions running, the memory usage will be quite high. Are there any memory
> pools which are created, which can be controlled by external parameters?
>
>      3rd question:
>
>      For some reason I have it in my head that the wthttpd server cannot
> handle many connections in parallel. I know that fastcgi offers great
> performance in such scenarios. Maybe I read the note on wthttpd in the older
> documentation , or maybe I'm just plain wrong. However  I would like to ask,
> how many connections can wthttpd handle before performance becomes bad.
>
>     If you would like me to post questions 2 and 3 as separate items,
> please let me know.
>
>     Many thanks for your help in advance.
>
> Kind Regards,
> Neil
>
>
>
>
>
> ------------------------------------------------------------------------------
> Using storage to extend the benefits of virtualization and iSCSI
> Virtualization increases hardware utilization and delivers a new level of
> agility. Learn what those decisions are and how to modernize your storage
> and backup environments for virtualization.
> http://www.accelacomm.com/jaw/sfnl/114/51434361/
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to