You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Guofeng Zhang <gu...@gmail.com> on 2016/12/18 15:08:36 UTC
Shiro call my session dao's doReadSession and doUpdateSession many times?
Hi,
I created a session dao to store the shiro session to Redis so that the
session could be shared across several application instances. But I found
that the doReadSession() and doUpdateSession() are invoked many many times
for a sing request and cause my application runs very slow in the heavy
load.
Is there any way to make it more efficient?
Your advice is appreciated.
Thanks,
Guofeng
Re: Shiro call my session dao's doReadSession and doUpdateSession
many times?
Posted by Brian Demers <br...@gmail.com>.
This is likely cache implementation specific, but you could probably just
requesting a session once and storing it in the current request, any other
reads for that request would get the local copy.
This would NOT be fool proof as multiple requests could update information
in the session, and you could end up with stale cache.
On Mon, Dec 19, 2016 at 8:13 AM, Curtis Wittner <cu...@ints.com>
wrote:
> I am also interested. I am using zookeeper for my session cache and have
> had to implement storing the sessions in memory as well so that the cache
> get process can pull from memory unless the zookeeper instance has been
> updated.
>
>
> Curtis Wittner
> Senior Software Developer
> Integrated Services, Inc.
> curtis.wittner@ints.com
> www.ints.com
> P:800-252-3099 x 235 <(800)%20252-3099>
> F:503-968-9100 <(503)%20968-9100>
>
> On Sun, Dec 18, 2016 at 12:18 PM, Rob Young <bo...@gmail.com> wrote:
>
>> I’m massively interested in the answer to this question. I need to
>> implement user session caching at some point in a Shiro web application, I
>> feel like this is one of those questions whose answer would be quite
>> instructive!
>>
>> > On Dec 18, 2016, at 10:08 AM, Guofeng Zhang <gu...@gmail.com>
>> wrote:
>> >
>> > Hi,
>> >
>> > I created a session dao to store the shiro session to Redis so that the
>> session could be shared across several application instances. But I found
>> that the doReadSession() and doUpdateSession() are invoked many many times
>> for a sing request and cause my application runs very slow in the heavy
>> load.
>> >
>> > Is there any way to make it more efficient?
>> >
>> > Your advice is appreciated.
>> >
>> > Thanks,
>> >
>> > Guofeng
>> >
>> >
>> >
>>
>>
>
Re: Shiro call my session dao's doReadSession and doUpdateSession
many times?
Posted by Curtis Wittner <cu...@ints.com>.
I am also interested. I am using zookeeper for my session cache and have
had to implement storing the sessions in memory as well so that the cache
get process can pull from memory unless the zookeeper instance has been
updated.
Curtis Wittner
Senior Software Developer
Integrated Services, Inc.
curtis.wittner@ints.com
www.ints.com
P:800-252-3099 x 235
F:503-968-9100
On Sun, Dec 18, 2016 at 12:18 PM, Rob Young <bo...@gmail.com> wrote:
> I’m massively interested in the answer to this question. I need to
> implement user session caching at some point in a Shiro web application, I
> feel like this is one of those questions whose answer would be quite
> instructive!
>
> > On Dec 18, 2016, at 10:08 AM, Guofeng Zhang <gu...@gmail.com> wrote:
> >
> > Hi,
> >
> > I created a session dao to store the shiro session to Redis so that the
> session could be shared across several application instances. But I found
> that the doReadSession() and doUpdateSession() are invoked many many times
> for a sing request and cause my application runs very slow in the heavy
> load.
> >
> > Is there any way to make it more efficient?
> >
> > Your advice is appreciated.
> >
> > Thanks,
> >
> > Guofeng
> >
> >
> >
>
>
Re: Shiro call my session dao's doReadSession and doUpdateSession many times?
Posted by Rob Young <bo...@gmail.com>.
I’m massively interested in the answer to this question. I need to implement user session caching at some point in a Shiro web application, I feel like this is one of those questions whose answer would be quite instructive!
> On Dec 18, 2016, at 10:08 AM, Guofeng Zhang <gu...@gmail.com> wrote:
>
> Hi,
>
> I created a session dao to store the shiro session to Redis so that the session could be shared across several application instances. But I found that the doReadSession() and doUpdateSession() are invoked many many times for a sing request and cause my application runs very slow in the heavy load.
>
> Is there any way to make it more efficient?
>
> Your advice is appreciated.
>
> Thanks,
>
> Guofeng
>
>
>