mongodb - PHP Mongo Session Handler and Sharding -


i using

https://github.com/symfony/symfony/blob/master/src/symfony/component/httpfoundation/session/storage/handler/mongodbsessionhandler.php

as session handler php app.

our app expecting high volume traffic, experimenting sharding mongo store session.

i have set shard according the document, , things fine before shard collection (i can see session document being created in session collection).

as enabled sharding on session using sharding key sess_id, no session document gets created (i.e. count never change), , see these lines in mongos log whenever visit php page: resetting shard version of mydb.session on my.hsard.ip.address:port, version zero

i have tried shard other collection , works fine, tells me sharding setup correct.

anybody have clue of might wrong? i'm using mongo 2.2.3.

found cause.

it because write function in mongodbsessionhandler.php comes symfony version using not work sharding.

the mongodbsessionhandler.php using implements write this:

$mongo->update({shardkey:1}, {shardkey:1, data:2}, {upsert:true}) 

which not allowed, because cannot change shard key.

solution use latest version of mongodbsessionhandler.php in github.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -