Comments (2)
FWIW,
I use Dynamoid with passenger and warm it up before forking and have not had this problem. If you track it down, I'd like to hear about the root cause.
Sent from my iPhone
On Apr 10, 2013, at 5:26 AM, Ryan Conway [email protected] wrote:
Hey there,
We're looking into using Unicorn's 'preload_app' option, which speeds up app startup and reduces memory usage by spawning a single instance of your application, and then forking that several times for each worker.
The only downside is that you need to make sure you re-initiate all external connections in an 'after_fork' block. We've set up ours to do the following:
after_fork do |server, worker|
Dynamoid::Adapter.reconnect!
end
Unfortunately, this doesn't seem to work as expected, as running under Unicorn with 'preload_app true' we sometimes get responses back that appear to be for a different request, which causes problems. If we set 'preload_app false' this issue goes away.We're not 100% certain the issue is in Dynamoid itself, but figured you'd be a good person to ask :D
If you have any advice for using Dynamoid within an environment such as Unicorn preload, or Passenger when set to spawning mode, I welcome it!
Thanks!
Ryan—
Reply to this email directly or view it on GitHub.
from dynamoid.
I wasn't able to get to the bottom of it unfortunately, so I took a different approach, and moved our DB connection code into a separate file, which is only included in the Unicorn.rb, in the 'after_fork' block. This guarantees that no existing DB connection remains, and the issues have now been resolved.
from dynamoid.
Related Issues (20)
- Support for ActiveRecord "subset conditions" HOT 2
- Record should be destroyed whether it has a range key or not
- No support for BETWEEN queries on range keys HOT 2
- String max length HOT 2
- Model reload method should not silently fail to reload
- Assigning associations to a model automatically persists that model to the table.
- Getting weird "Table already exists" error when the table exists V.S. "Resources not found" error when table is deleted. HOT 3
- Exception when creating new User HOT 1
- Problem while creating new instance
- adding any index results crash HOT 3
- Retries in dynamoid HOT 2
- Making multiple table update atomic HOT 3
- load fails on finding additional attributes
- aws_sdk Adapter - require': cannot load such file -- aws (LoadError) HOT 2
- Deprecate this gem officially HOT 4
- Rails 4.2? HOT 1
- AWS v2? HOT 1
- Dynamoid::Persistence#update! should be running :save callbacks HOT 1
- Dynamoid::Persistence#save never runs :update callbacks
- Error "value must be enumerable"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dynamoid.