Re: Questions about memcached in general and failover

2012-10-22 Thread Roberto Spadim
a point... a query like
select * from session_table where session_id='x'
where session_id is a primary key is very very fast, we are talking
about < 0.1 seconds, with memcached you are trying to go down to <0.01
seconds
why should you care about speed in internet if the time to consider a
page slow is near 3 seconds?
you could use database without problems when memcached goes down and a
simple query (in primary key) isn't database intensive, some guys use
a mysql table per session when session ends DROP TABLE session_xyz
this make the system more proof of broken engine (that don't work fast
with frequently delete+update+select queries) other option is a
session_table with many partitions, just some ideas..

2012/10/22 Perrin Harkins :
> On Mon, Oct 22, 2012 at 5:09 AM, SAE  wrote:
>> But as explained above. If one of the memcached servers goes down. Some
>> users experience the problem, that they not only get logged out but also
>> have problems browsing the site at all or logging back in. Every page needs
>> minutes to load then and it seems like the client is still trying to reach
>> the server that got down and he's not trying that for only the first few
>> clicks after one server went down, but for every click after that.
>
> That sounds like an issue with your memcached client, rather than the
> server.  See if there's a mailing list or other support for the client
> you're using.
>
> - Perrin



-- 
Roberto Spadim


Re: Questions about memcached in general and failover

2012-10-22 Thread Perrin Harkins
On Mon, Oct 22, 2012 at 5:09 AM, SAE  wrote:
> But as explained above. If one of the memcached servers goes down. Some
> users experience the problem, that they not only get logged out but also
> have problems browsing the site at all or logging back in. Every page needs
> minutes to load then and it seems like the client is still trying to reach
> the server that got down and he's not trying that for only the first few
> clicks after one server went down, but for every click after that.

That sounds like an issue with your memcached client, rather than the
server.  See if there's a mailing list or other support for the client
you're using.

- Perrin


Re: Questions about memcached in general and failover

2012-10-22 Thread SAE
First of all I want to thank all of you for your replys and I want to 
apologize, that I didn't replied earlier, but part of last week I was ill. 

However, I may have not put enough emphasis on my real problem. Some users 
losing their sessions is one thing that isn't that pretty, but not the end 
of the world. 
But as explained above. If one of the memcached servers goes down. Some 
users experience the problem, that they not only get logged out but also 
have problems browsing the site at all or logging back in. Every page needs 
minutes to load then and it seems like the client is still trying to reach 
the server that got down and he's not trying that for only the first few 
clicks after one server went down, but for every click after that. 




Re: Questions about memcached in general and failover

2012-10-18 Thread Roberto Spadim
thereĀ“s another solution, but i don't remember the name, redis could do the
job (i think)

2012/10/16 Les Mikesell 

> On Tue, Oct 16, 2012 at 11:22 AM, Kiran Kumar  wrote:
> >
> > Memcache doesn't automatically comes with Replication facility (High
> > Avialibility) , i recomend you to use Repcache Patch on top of your
> existing
> > mecached for obtaining Replication of data
> >  within your servers .
> >
> > The only issue i see is that Repcached only works / Successfully Worked
> when
> > there are only two servers two replicate .
>
> If you are going to be stuck with this restriction - and have to build
> your own fail-over, is there any advantage to using memcache compared
> to redis with its much larger feature set?
>
> --
>Les Mikesell
>   lesmikes...@gmail.comi
>



-- 
Roberto Spadim


Re: Questions about memcached in general and failover

2012-10-16 Thread Perrin Harkins
On Tue, Oct 16, 2012 at 12:59 PM, Les Mikesell  wrote:
> If you are going to be stuck with this restriction - and have to build
> your own fail-over, is there any advantage to using memcache compared
> to redis with its much larger feature set?

I agree.  If you need durability (i.e. if it would be a big problem to
lose some of the data in memcached), then memcached is the wrong tool
for you.  It aims to provide a level of failover that allows memcached
requests to continue to work, but does not aim to maintain data.

- Perrin


Re: Questions about memcached in general and failover

2012-10-16 Thread Les Mikesell
On Tue, Oct 16, 2012 at 11:22 AM, Kiran Kumar  wrote:
>
> Memcache doesn't automatically comes with Replication facility (High
> Avialibility) , i recomend you to use Repcache Patch on top of your existing
> mecached for obtaining Replication of data
>  within your servers .
>
> The only issue i see is that Repcached only works / Successfully Worked when
> there are only two servers two replicate .

If you are going to be stuck with this restriction - and have to build
your own fail-over, is there any advantage to using memcache compared
to redis with its much larger feature set?

-- 
   Les Mikesell
  lesmikes...@gmail.comi


Re: Questions about memcached in general and failover

2012-10-16 Thread Kiran Kumar
garulf , 

Memcache doesn't automatically comes with Replication facility (High 
Avialibility) , i recomend you to use Repcache Patch on top of your 
existing  mecached for obtaining Replication of data 
 within your servers .

The only issue i see is that Repcached only works / Successfully Worked 
when there are only two servers two replicate .  

On Tuesday, 16 October 2012 21:42:18 UTC+5:30, garulf wrote:
>
>
>
> 2012/10/16 SAE >
>
>> Hello, 
>>
>> Hi
>  
>
>> We recently implemented memcached to keep our database from crashing 
>> because of too many connections to it. 
>>
>> Now we have two memcached servers which handle the DB-access and as long 
>> as both servers are online we encounter no problems. However when one of 
>> the goes down. Half our users loose their sessions. 
>>
> Can anyone help me to figure out what is going on here, please? 
>>
>
> Maybe you should read at this http://dormando.livejournal.com/495593.html
>   
>
>>
>> Another thing is, that we would prefer to have the exact same data 
>> available on both memcached-Servers. So if one of the two can't be reached, 
>> the other one is asked. So no user is losing his session when one server 
>> suddenly goes down. 
>>
>
> Memcached has a different architecture...  If you have same data on both 
> memcached server you have to do cache invalidation and data sync.. a 
> nightmare...
>
> M
>
>

Re: Questions about memcached in general and failover

2012-10-16 Thread Marco Oliverio
2012/10/16 SAE 

> Hello,
>
> Hi


> We recently implemented memcached to keep our database from crashing
> because of too many connections to it.
>
> Now we have two memcached servers which handle the DB-access and as long
> as both servers are online we encounter no problems. However when one of
> the goes down. Half our users loose their sessions.
>
Can anyone help me to figure out what is going on here, please?
>

Maybe you should read at this http://dormando.livejournal.com/495593.html


>
> Another thing is, that we would prefer to have the exact same data
> available on both memcached-Servers. So if one of the two can't be reached,
> the other one is asked. So no user is losing his session when one server
> suddenly goes down.
>

Memcached has a different architecture...  If you have same data on both
memcached server you have to do cache invalidation and data sync.. a
nightmare...

M


Questions about memcached in general and failover

2012-10-16 Thread SAE
Hello, 

We recently implemented memcached to keep our database from crashing 
because of too many connections to it. 

Now we have two memcached servers which handle the DB-access and as long as 
both servers are online we encounter no problems. However when one of the 
goes down. Half our users loose their sessions. While thats ugly it is 
actually not the biggest problem. 
Because if one server goes down users not only get kicked out, but they 
also struggle to use the site at all. It seems like the apache-client 
doesn't recognizes that one of the memcached servers went down and still 
tries to reach that server on every fracking request.
The only thing that were changed on the memcached client were the 
implementation of "memcached.so" in php.ini and changing the 
[Session]-settings to "session.save_handler memcached" and 
"session.save_path = memc01, memc02". 

Can anyone help me to figure out what is going on here, please? 

Another thing is, that we would prefer to have the exact same data 
available on both memcached-Servers. So if one of the two can't be reached, 
the other one is asked. So no user is losing his session when one server 
suddenly goes down. 

I already searched a lot and it actually confused me quite a bit (memcache 
and memcached) and didn't bring up any results for me specially my first 
problem. Maybe I'm just terrible at googling or to stupid to find the 
solution.

Oh, and please don't feel offended by my probably bad grammar and spelling, 
while I am listening a reading quite a lot english. I don't write or speak 
the language often.

However, any kind of help is welcome. :)

SAE