slaves / multithreading

Hello,Could you please clarify the following thing?What is the different between running several q -p processesand q -s ?I found that -s works with peach, but is it only for peach.Is it possible to send direct request to the slave thread, likesending cmd to the other instance with (-p) ?If yes, what is the different between -s and run several -p ?Thank you,-- Regards,? Alexander.

I may not be completely correct about this, but with slave threads,
each thread consumes same amount of memory as primary thread. With -p
the input queue is multithreaded and q uses references to supply data
to each spawned thread, which means less memory consumption.

-s is useful in combination with par.txt (multiple SANs) while -p is
useful when you have multiple cores, number of client connections can
be controlled by a separate mechanism, and data is in memory (so
memory usage doesn’t go up).

On Mon, Jan 23, 2012 at 6:11 PM, Alexander Epifanov wro=
te:
> Hello,
>
> Could you please clarify the following thing?
>
> What is the different between running several q -p processes
> and q -s ?
>
> I found that -s works with peach, but is it only for peach.
> Is it possible to send direct request to the slave thread, like
> sending cmd to the other instance with (-p) ?
> If yes, what is the different between -s and run several -p ?
>
> Thank you,
>
> –
> Regards,
> =A0 Alexander.
>
> –
>

Submitted via Google Groups

Do I understand correct, that -s make fork? does it use lock/mutex?
Are there only one operation which support -s: peach?

Regards,

-s n

starts off a threadpool of n threads for use with peach (parallel each).

each thread has its own heap, currently a minimum of 64MB.

each slave thread has read-access to globals; the main thread has read/write access to globals.

you can give work to slave threads through peach only.

peach is like a fork/join, but the thread allocation to elements is fixed on the invocation of peach, so if a thread finishes process its elements early it will not steal remaining elements queued for another thread.

q -p <port> where port is a positive number has only one thread. Running several of these would mean that any global data is not shared, unless mapped from the OS. This mode is useful for spreading the load of a system horizontally, e.g. many rdbs, many hdbs, gateway scattering/gathering queries/responses accordingly.

q -p <port> where port is a negative number starts a thread for each incoming connection. This is designed for serving static (or infrequently updated) in-memory data to an externally controlled number of clients.

Whichever solution you choose really depends on what you are trying to achieve.

Regarding what Rohit said about memory consumption, each thread uses whatever memory it needs to for its task, and is independent of other threads.

Maybe what Rohit was referring to was “-w” where limit applies to each thread,
means that sum memory consumption will be:
w*s