-
Notifications
You must be signed in to change notification settings - Fork 57
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
Copycopter slows down development and staging environment to the point that it's unusable #9
Comments
Hi Aaron, Is this in a single request to your server, or to a set of requests (including assets). The reason I ask is that, in Rails 3.1, the asset requests are handled by Sprockets instead of just ActionDispatch::Static, and the copycopter_client fetches new blurbs in each non-static request, making the asset requests very slow. That's an issue we definitely want to address. If that's not the case, is it consistently 3-7 seconds, e.g. an intermittent network issue? I'm curious if your application's copy content is much larger than typical. Can you let us know your account so we can take a look? Feel free to open a private issue on http://help.copycopter.com/ if you'd rather continue the discussion there. In the meantime, the RequestSync middleware (which syncs copy on each request) is only enabled for environments included in
Thanks, |
Hi Jason, We're on a Rails 3.0.X app. It's the main request that's taking 3-7 seconds every time. We have tried setting In other words, we need to toggle between including It would be nice to have more granular settings for these things in each environment. Ideally, until the sync time is sped up greatly, we would want to be able to set it up so Staging used 5min sync instead of request but still used draft, and development used 5 minute sync (or on demand?), draft, and uploaded new keys/defaults. Thanks, Aaron |
Hi Aaron, Thanks. I'd recommend two changes - one that can be done with the configuration, the other which needs code changes to the copycopter_client. For the code changes, I'd like @jferris opinion on the API before we make the change in the released gem, but you can fork the gem and patch it in the meantime to keep your development and staging speedy. My general approach would be to leave the You can set the polling delay through configuration:
Disabling RequestSync is currently tied to whether your Rails env is considered a development environment. Since there are other concerns tied to running in a development environment (specifically draft content vs published content), I think we should add another configuration option to allow explicitly disabling the RequestSync. It seems to me that if you want to disable RequestSync in any development environment, you would want to disable it for all development environments (e.g. if dev is slow, staging is also slow). There's no config option for this presently, so I'd recommend forking the gem and removing/commenting: Eventually, there could be a Thanks, |
Thanks Jason. Rather than forking and making that change I'm trying this out: CopycopterClient.configure do |config|
config.api_key = ''
config.http_read_timeout = 60
config.http_open_timeout = 60
config.polling_delay = 10 unless Rails.env.production? # seconds, defaults to 300 seconds or 5 minutes
config.middleware = nil
end Setting middleware to nil seems to have the same effect. I also included the |
@aaronjensen This is now fixed in 1.1.2. You should be able to update the gem. I've been keeping my timeouts at 30 seconds just in case, though. https://github.com/thoughtbot/copycopter_client/commit/fa1ed25085f164c4cc25495e31a16eb227e77061 |
This fix is great, but wasn't my problem. My problem is that devise uploaded 9 or so additional languages and my strings file is up to 2.5MB. downloading a 2.5MB from copycopter every request is the problem. |
@aaronjensen We're working on ways to deal with the larger download sizes and unused languages. In the meantime, I recommend you keep your configuration workaround in place. Thanks for your patience. |
Does anyone (new maintainers or old) have any new thoughts on this? I want to use copycopter, but devise and simple_form-related translation bloat does indeed make this unusable. I'm sitting on 5.08mb of json for the draft_blurbs. The etags obviously help, but things still choke up often. I'd love a way to specify that i only want certain locales (the app I'm currently working on is US-centric). In the meantime, I've added some code to my copycopter server to add Any thoughts are appreciated. I'm happy to pitch in and work on a pull request if someone wants to point me in the right direction. Thanks. |
My plan was to add a locale manager to the UI that would let users select which locales should be downloaded. I also considered an option in the client to prevent some locales from being uploaded in the first place. Another option would be to have locales "activate" in the client once they were actually requested by the application. That way you could automatically decide which locales to send to the server based on which ones were in use. |
A locale manager seems like a good fix. Automagically adding a locale is flashy and all, but not even remotely useful given that it seems to also lead to locale-bloat. |
Have you tried to use copycopter only for development environment ( https://gist.github.com/p1nox/4755262 ) ? It could be an easy workaround... What do you think? |
It takes anywhere from 3-7 seconds usually for copycopter to check for updates to strings. I don't know if it's because our app has grown to the point where the dump is several MB or what, but it makes the development environment unusable. Furthermore, in order to disable the refresh we have to set the development environments to
[]
which has the unfortunate side effect of not updating the server whenever we add a new key. So we really need to manually switch between running in "development" (according to copycopter) and not.Is there a way to speed things up and/or have a hybrid environment in which new strings will get pushed to the server but it won't check for updates every request?
The text was updated successfully, but these errors were encountered: