TheCloudlessSky / Harbour.RedisSessionStateStore

A Redis based SessionStateStoreProvider written in C# using ServiceStack.Redis.
MIT License
166 stars 76 forks source link

After switching to Redis provider web app got very slow. #12

Open fenix2222 opened 10 years ago

fenix2222 commented 10 years ago

Hi Support,

I have added your solution to my web app and evertyhing seemed to work fine, but now I am getting ocassional slow down of the site, some pages load for 1-2 minutes. As soon as I switch back to InProc session mode, everything is running very fast, then when I switch to Redis (in config), it is either fast as well or randomly slow. I wonder if there is anything I am missing. It is like it has issues writting to Redis database. I don't know. Any suggestions?

TheCloudlessSky commented 10 years ago

Hey @fenix2222, please check out the discussion in #9. Try and use the non-watch version as in the comments. Provide as much details as possible. If you don't see Redis hanging (use redis-cli watch to see what's going on) and it's not related to #9, please re-open/let me know! Thanks!

fenix2222 commented 10 years ago

I don't know what non-watch version means... How do I use it? Is it in Redis conf file or in your provider?

TheCloudlessSky commented 10 years ago

It's in this provider. Downgrade to version 1.0.0 and let me know how that works out.

fenix2222 commented 10 years ago

Thanks. Are there any culpits with using v1.0 as opposed to v1.1. Obviously you fixed something in 1,1...

On Sun, Feb 16, 2014 at 1:29 PM, Adrian Phinney notifications@github.comwrote:

It's in this provider. Downgrade to version 1.0.0 and let me know how that works out.

Reply to this email directly or view it on GitHubhttps://github.com/TheCloudlessSky/Harbour.RedisSessionStateStore/issues/12#issuecomment-35176296 .

Kind Regards,

Igor Goldobin Microsoft Certified Professional Developer MInfTech, BEng, BIT, MCPD Custom Web Design, IT Consulting, Enterprise Systems Phone: 0409 096 917 Email: igor.goldobin@gmail.com Visit my website: www.e-fenix.com

TheCloudlessSky commented 10 years ago

Well, I implemented WATCH/UNWATCH with 054984e1. It helps with concurrency issues. But it seems to be causing some issues for some people as seen in #9. Please give 1.0.0 a try and let me know how it goes!

TheCloudlessSky commented 10 years ago

@fenix2222 I just released v1.2.0 which hopefully fixes this issue. Can you first give v1.0.0 a try, then try v1.1.0 and then try v1.2.0 to see if I've fixed it? Thanks!

fenix2222 commented 10 years ago

Thanks. I will try it later tonight ir tomorrow. It is not that easy to test as it world ok sometimes but then slows down, then works ok...

On Sunday, February 16, 2014, Adrian Phinney notifications@github.com wrote:

@fenix2222 https://github.com/fenix2222 I just released v1.2.0 which hopefully fixes this issue. Can you first give v1.0.0 a try, then try v1.1.0 and then try v1.2.0 to see if I've fixed it? Thanks!

Reply to this email directly or view it on GitHubhttps://github.com/TheCloudlessSky/Harbour.RedisSessionStateStore/issues/12#issuecomment-35177306 .

Kind Regards,

Igor Goldobin Microsoft Certified Professional Developer MInfTech, BEng, BIT, MCPD Custom Web Design, IT Consulting, Enterprise Systems Phone: 0409 096 917 Email: igor.goldobin@gmail.com Visit my website: www.e-fenix.com

fenix2222 commented 10 years ago

Hi Adrian,

If I have provider configured in web.config, do I still need it to be configured in Global.asax of ASP.NET MVC? I have this in web.config

[image: Inline image 1] and this in Global.asax. Documentation is a bit limited, so I am making sure I got it right. I have a suspicion I may just need one or the other.

[image: Inline image 2]

On Sun, Feb 16, 2014 at 4:29 PM, Igor Goldobin igor.goldobin@gmail.comwrote:

Thanks. I will try it later tonight ir tomorrow. It is not that easy to test as it world ok sometimes but then slows down, then works ok...

On Sunday, February 16, 2014, Adrian Phinney notifications@github.com wrote:

@fenix2222 https://github.com/fenix2222 I just released v1.2.0 which hopefully fixes this issue. Can you first give v1.0.0 a try, then try v1.1.0 and then try v1.2.0 to see if I've fixed it? Thanks!

Reply to this email directly or view it on GitHubhttps://github.com/TheCloudlessSky/Harbour.RedisSessionStateStore/issues/12#issuecomment-35177306 .

Kind Regards,

Igor Goldobin Microsoft Certified Professional Developer MInfTech, BEng, BIT, MCPD Custom Web Design, IT Consulting, Enterprise Systems Phone: 0409 096 917 Email: igor.goldobin@gmail.com Visit my website: www.e-fenix.com

Kind Regards,

Igor Goldobin Microsoft Certified Professional Developer MInfTech, BEng, BIT, MCPD Custom Web Design, IT Consulting, Enterprise Systems Phone: 0409 096 917 Email: igor.goldobin@gmail.com Visit my website: www.e-fenix.com

TheCloudlessSky commented 10 years ago

Hey - you just need to configure it in one place. The images didn't show up. Perhaps you can paste them directly on GitHub? The only reason you'd need to configure it in the Global.asax is if you want more control or if you're already using Redis in another part of your application.

fenix2222 commented 10 years ago

I tried version 1.2 with web.config settings only. I am now getting Expected 'QUEUED' got '1', sPort 58227 image

TheCloudlessSky commented 10 years ago

Hmm, that's weird. You can see the code that does this from that StackTrace. According to ServiceStack.Redis's test suite, this should be possible. I'm going to have to investigate more as to why the replay isn't working. Can you tell me a little bit about the load on your site (how many users, requests per-second etc)?

fenix2222 commented 10 years ago

Just me. I am only testing with one account...

On Mon, Feb 17, 2014 at 11:38 AM, Adrian Phinney notifications@github.comwrote:

Hmm, that's weird. You can see the codehttps://github.com/TheCloudlessSky/Harbour.RedisSessionStateStore/blob/master/src/Harbour.RedisSessionStateStore/RedisSessionStateStoreProvider.cs#L226that does this from that StackTrace. According to ServiceStack.Redis's test suitehttps://github.com/ServiceStack/ServiceStack.Redis/blob/1bcfef15c565c9945cc340aa8f9aa8d3a3d01130/tests/ServiceStack.Redis.Tests/RedisTransactionTests.cs#L241, this should be possible. I'm going to have to investigate more as to why the replay isn't working. Can you tell me a little bit about the load on your site (how many users etc)?

Reply to this email directly or view it on GitHubhttps://github.com/TheCloudlessSky/Harbour.RedisSessionStateStore/issues/12#issuecomment-35223006 .

Kind Regards,

Igor Goldobin Microsoft Certified Professional Developer MInfTech, BEng, BIT, MCPD Custom Web Design, IT Consulting, Enterprise Systems Phone: 0409 096 917 Email: igor.goldobin@gmail.com Visit my website: www.e-fenix.com

TheCloudlessSky commented 10 years ago

Really? Ok, that's weird. I'm going to have to try and figure this out tomorrow. For now, you can use 1.0.0 and you shouldn't have any troubles.

TheCloudlessSky commented 10 years ago

This one was a pain to reproduce... eventually a hard refresh in the browser was able to reproduce it. I've released v1.3.0 that uses a distributed lock rather than watch/unwatch. Please update and let me know if this fixes your issues. Also update ServiceStack.Common, ServiceStack.Redis, and ServiceStack.Text to 3.9.71 (The dependencies are now >= 3.9 && < 4.0). :shipit:

fenix2222 commented 10 years ago

Thanks. I will test it tonight. BTW are you from Sydney?

On Tue, Feb 18, 2014 at 11:25 AM, Adrian Phinney notifications@github.comwrote:

This one was a pain to reproduce... eventually a hard refresh in the browser was able to reproduce it. I've released v1.3.0 that uses a distributed lock rather than watch/unwatch. Please update and let me know if this fixes your issues. Also update ServiceStack.Common, ServiceStack.Redis, and ServiceStack.Text to 3.9.71 (The dependencies are now >= 3.9 && < 4.0). [image: :shipit:]

Reply to this email directly or view it on GitHubhttps://github.com/TheCloudlessSky/Harbour.RedisSessionStateStore/issues/12#issuecomment-35340548 .

Kind Regards,

Igor Goldobin Microsoft Certified Professional Developer MInfTech, BEng, BIT, MCPD Custom Web Design, IT Consulting, Enterprise Systems Phone: 0409 096 917 Email: igor.goldobin@gmail.com Visit my website: www.e-fenix.com

TheCloudlessSky commented 10 years ago

Nope - I'm from eastern Canada.

TheCloudlessSky commented 10 years ago

@fenix2222 Any luck with 1.3.0?

fenix2222 commented 10 years ago

I have it running, seems to be ok. It would be good to check once we get much more traffic.

On Fri, Feb 28, 2014 at 9:00 AM, Adrian Phinney notifications@github.comwrote:

@fenix2222 https://github.com/fenix2222 Any luck with 1.3.0?

Reply to this email directly or view it on GitHubhttps://github.com/TheCloudlessSky/Harbour.RedisSessionStateStore/issues/12#issuecomment-36302797 .

Kind Regards,

Igor Goldobin Microsoft Certified Professional Developer MInfTech, BEng, BIT, MCPD Custom Web Design, IT Consulting, Enterprise Systems Phone: 0409 096 917 Email: igor.goldobin@gmail.com Visit my website: www.e-fenix.com

TheCloudlessSky commented 10 years ago

@fenix2222 Did you guys get more traffic? How has it been performing?