Shared Table?

63 views
Skip to first unread message

Rollin Crittendon

unread,
Feb 18, 2015, 3:33:48 PM2/18/15
to openre...@googlegroups.com
I have done some things with the shared dictionary.  It works great, thank you!

I was wondering, if I want to share a table across processes, are the following the options today?
1) Serialize and deserialize the table on set and get.
2) Another option is to have sub-keys be string so "address.city", "address.zip" etc.

Any advice on this is much appreciated.

Thank you,

Rollin 

Yichun Zhang (agentzh)

unread,
Feb 18, 2015, 3:41:02 PM2/18/15
to openresty-en
Hello!

On Wed, Feb 18, 2015 at 12:33 PM, Rollin Crittendon wrote:
> I have done some things with the shared dictionary. It works great, thank
> you!
>
> I was wondering, if I want to share a table across processes, are the
> following the options today?
> 1) Serialize and deserialize the table on set and get.
> 2) Another option is to have sub-keys be string so "address.city",
> "address.zip" etc.
>

The second approach is usually much more efficient because
serialization is almost always an expensive operation. Having said
that, the 2nd approach may result in incomplete records in case of key
eviction when running out of storage. Just be prepared for it when the
dict size is configured small.

Regards,
-agentzh

Mike S

unread,
Feb 19, 2015, 10:46:12 AM2/19/15
to openre...@googlegroups.com
Hi

Is there any known size limit when declaring a shared dict? 

Yichun Zhang (agentzh)

unread,
Feb 19, 2015, 3:52:00 PM2/19/15
to openresty-en
Hello!

On Thu, Feb 19, 2015 at 7:46 AM, Mike S wrote:
> Is there any known size limit when declaring a shared dict?
>

No limits on the nginx side, but surely with limits in your system
(like virtual memory address space and physical memory size and etc).

Regards,
-agentzh

Robert Paprocki

unread,
Feb 19, 2015, 10:46:23 PM2/19/15
to openre...@googlegroups.com
Also keep in mind that performance will degrade logarithmically with dicts with hundreds of thousands of keys.
> --
> You received this message because you are subscribed to the Google Groups "openresty-en" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openresty-en...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages