-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no guide for using dynamodb for session handling for 2.x API #26
Comments
Thanks! We are working on some end-user documentation on the docs branch. I'll have to add a page about the session handler soon. |
is there any reason not to use a github wiki? |
More flexibility. The docs branch is setup for static site generation with Sphinx and reStructured Text. That way we have flexibility in the location and look of the docs. There are several PHP projects using Sphinx for docs already. If you install it, you can generate the docs site locally right now with a single command. We just haven't published the site anywhere yet. With the holidays over now, we plan to get moving on this. Restructured text is very similar to Markdown, so we hope to have others contribute to the docs as well once we get the ball rolling. |
Hey, We recently published our user guide here: http://docs.aws.amazon.com/aws-sdk-php-2/guide/latest/index.html. I have written up a guide to the session handler that we'll be adding soon. Care to review? You can see the content here: https://github.com/jeremeamia/aws-sdk-php/blob/399d736a347d190e3d10883db413c371f593fd66/docs/feature-dynamodb-session-handler.rst. Let me know if you think anything is missing or could be clarified. Thanks. |
Just read through it and looks like you covered it all from the code side, but I think you should include the php.ini changes also. I don't think you should default to the php.ini gc probability if it's recommended to run it on a cron instead, and I think it's pretty important to run it on a cron instead of the default PHP way so you don't have throughput problems, but instead of changing functionality you could just say set this: |
@ralph-tice Thanks for your feedback.
This is a tough one. While it isn't optimal, defaulting to these settings also allows the session handler to work in more restrictive PHP environments like shared hosting where users do not have access to the shell or cron.
I'm not a big fan of auto_prepend_file. It often leads to confusion because it fragments the bootstrapping process of an application. Another downside: what if you don't want all of your PHP scripts to start a session (e.g. command line scripts)? |
I don't want to suggest |
After reading your comments I think you're both right about auto_prepend_file being pretty environment specific (and not generally a great idea). Not sure I'm on the same page with the PHP directive -- does ini_set() address your particular concerns? Default PHP session GC behavior is really bad for a production DynamoDB table if you have lots of sessions created, you'll GC during peak and generally overrun your max throughput or be forced to over-provision. |
I added some more advisory text in this commit. Do you think that this helps? |
Yeah, that seems to cover all the bases. |
I've seen no mention for session autostart setting, but at least for me dynamodb sessions just doesn't work, I'm pretty happy with elasticache handling my sessions though, so I'm eager to see more sdk sintactyc sugar upcoming related to elasticache, wirh a good drop in replacememt for vanilla memcache drivers. |
@ralph-tice Thanks! @amenadiel To address your comments…
The
What do you mean by this? Are you saying that you think there is a bug or that it just does not fit your use case?
Sure, ElastiCache can also be a good solution for sessions.
Do you have any specific ideas for what we could do in the SDK?
The ElastiCache team has a custom memcache driver that supports auto discovery of all the nodes in your cache cluster. See Installing the ElastiCache Cluster Client for PHP in the ElastiCache service's Developer Guide. |
Closing this issue now. @amenadiel feel free to comment back on here if you get a chance. Thanks. |
The guide is now published: http://docs.aws.amazon.com/aws-sdk-php-2/guide/latest/feature-dynamodb-session-handler.html |
i'm still trying to figure out pull requests, so I've made a gist:
https://gist.github.com/4446893
this is intended to replace the instructions from http://aws.typepad.com/aws/2012/04/scalable-session-handling-in-php-using-amazon-dynamodb.html
it also pre-supposes installation of aws-sdk-php via composer
The text was updated successfully, but these errors were encountered: