Hello Hynek,

Tried exporting the settings and adding them to my settings.py. I also
updated to the latest django-livesettings from the repo using:

pip install -e hg+http://bitbucket.org/bkroeze/django-livesettings/
#egg=django-livesettings --upgrade

Still hit the same error. I am using apache bench to reproduce it.

ab -n 150 -c 100 http://www.my-test-site.com/accounts/login/?next=/

Any other suggestions?

Thanks for the help!

- Ragi

On Nov 10, 9:56 am, hynekcer <[email protected]> wrote:
> I offer a temporary solution for your problem under high load:
>
> Go tohttp://www.my_test_site.com/settings/export/
> (or use "Export" link on the settings page)
> Copy & paste the result to your settings.py
> It is notable that there is also a key-value pair: "'DB': False"
> So livesettings would be read very fast directly the from the exported
> values without need to wait for solving modules loading dependencies
> etc.
> You can read more in the documentation "Exporting 
> Settings"https://bitbucket.org/bkroeze/django-livesettings/src/tip/docs/usage.rst
>
> Please use the latest version of livesettings for sure. There was an
> important fix on September 21th for server process initialization. It
> also improved error logging but I am afraid it is not enough for your
> error.
>
> I expect that "multithread" is an imortant circumstance.
> What is your deployment and the minimal and maximal number of django
> processes are running? What if you set both numbers the same?
> (increase the minimal)
>
> Is not the *high load* so high that timeouts or deadlock are possible
> or response times are always acceptable and only more processes/
> threads are started/restarted exactly at the same time +-  < 0.5 sec?
>
> I would like if you later can test a new solution again with
> livesettings db storage enabled ('DB': True) after I investigate the
> cause and write a patch.
>
> -- Hynek
>
> On 10 lis, 03:29, Ragi Burhum <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hello list,
>
> > I am seeing an intermittent error that only appears every once in
> > awhile related to django-livesettings.
>
> > Call stack below:
>
> > Traceback (most recent call last):
>
> >  File "/srv/my_test_site/my_test_site_env/lib/python2.6/site-packages/
> > django/core/handlers/base.py", line 101, in get_response
> >    request.path_info)
>
> >  File "/srv/my_test_site/my_test_site_env/lib/python2.6/site-packages/
> > django/core/urlresolvers.py", line 250, in resolve
> >    for pattern in self.url_patterns:
>
> >  File "/srv/my_test_site/my_test_site_env/lib/python2.6/site-packages/
> > django/core/urlresolvers.py", line 279, in _get_url_patterns
> >    patterns = getattr(self.urlconf_module, "urlpatterns",
> > self.urlconf_module)
>
> >  File "/srv/my_test_site/my_test_site_env/lib/python2.6/site-packages/
> > django/core/urlresolvers.py", line 274, in _get_urlconf_module
> >    self._urlconf_module = import_module(self.urlconf_name)
>
> >  File "/srv/my_test_site/my_test_site_env/lib/python2.6/site-packages/
> > django/utils/importlib.py", line 35, in import_module
> >    __import__(name)
>
> >  File "/srv/my_test_site/my_test_site/server/my_test_site/urls.py",
> > line 5, in <module>
> >    from satchmo_store.urls import urlpatterns as satchmo_urlpatterns
>
> >  File "/srv/my_test_site/my_test_site_env/src/satchmo/satchmo/apps/
> > satchmo_store/urls/__init__.py", line 28, in <module>
> >    from default import urlpatterns as defaultpatterns
>
> >  File "/srv/my_test_site/my_test_site_env/src/satchmo/satchmo/apps/
> > satchmo_store/urls/default.py", line 9, in <module>
> >    admin.autodiscover()
>
> >  File "/srv/my_test_site/my_test_site_env/lib/python2.6/site-packages/
> > django/contrib/admin/__init__.py", line 26, in autodiscover
> >    import_module('%s.admin' % app)
>
> >  File "/srv/my_test_site/my_test_site_env/lib/python2.6/site-packages/
> > django/utils/importlib.py", line 35, in import_module
> >    __import__(name)
>
> >  File "/srv/my_test_site/my_test_site_env/src/satchmo/satchmo/apps/
> > product/admin.py", line 129, in <module>
> >    class CategoryOptions(admin.ModelAdmin):
>
> >  File "/srv/my_test_site/my_test_site_env/src/satchmo/satchmo/apps/
> > product/admin.py", line 131, in CategoryOptions
> >    if config_value('SHOP','SHOW_SITE'):
>
> >  File "/srv/my_test_site/my_test_site_env/src/django-livesettings/
> > livesettings/functions.py", line 204, in config_value
> >    return config_get(group, key).value
>
> >  File "/srv/my_test_site/my_test_site_env/src/django-livesettings/
> > livesettings/functions.py", line 149, in config_get
> >    return ConfigurationSettings().get_config(group, key)
>
> >  File "/srv/my_test_site/my_test_site_env/src/django-livesettings/
> > livesettings/functions.py", line 66, in get_config
> >    raise SettingNotSet('%s config group does not exist' % group)
>
> > SettingNotSet: ('SHOP config group does not exist', None)
>
> > <WSGIRequest
> > GET:<QueryDict: {}>,
> > POST:<QueryDict: {}>,
> > COOKIES:{},
> > META:{'DOCUMENT_ROOT': '/htdocs',
> >  'GATEWAY_INTERFACE': 'CGI/1.1',
> >  'HTTP_ACCEPT_CHARSET': 'utf-8,ISO-8859-1;q=0.5',
> >  'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
> >  'HTTP_HOST': 'www.my_test_site.com',
> >  'HTTP_USER_AGENT': 'Mozilla/5.0 (compatible; Wasitup 
> > monitoring;http://wasitup.com)',
> >  'PATH': '/usr/local/bin:/usr/bin:/bin',
> >  'PATH_INFO': u'/',
> >  'PATH_TRANSLATED': '/srv/my_test_site/my_test_site/server/
> > my_test_site/conf/my_test_site.wsgi/',
> >  'QUERY_STRING': '',
> >  'REMOTE_ADDR': '178.79.135.13',
> >  'REMOTE_PORT': '56323',
> >  'REQUEST_METHOD': 'HEAD',
> >  'REQUEST_URI': '/',
> >  'SCRIPT_FILENAME': '/srv/my_test_site/my_test_site/server/
> > my_test_site/conf/my_test_site.wsgi',
> >  'SCRIPT_NAME': u'',
> >  'SERVER_ADDR': '10.82.154.159',
> >  'SERVER_ADMIN': 'ragi@my_test_site.com',
> >  'SERVER_NAME': 'www.my_test_site.com',
> >  'SERVER_PORT': '80',
> >  'SERVER_PROTOCOL': 'HTTP/1.1',
> >  'SERVER_SIGNATURE': '<address>Apache/2.2.14 (Ubuntu) Server 
> > atwww.my_test_site.comPort80</address>\n',
> >  'SERVER_SOFTWARE': 'Apache/2.2.14 (Ubuntu)',
> >  'mod_wsgi.application_group': 'www.my_test_site.com|',
> >  'mod_wsgi.callable_object': 'application',
> >  'mod_wsgi.listener_host': '',
> >  'mod_wsgi.listener_port': '80',
> >  'mod_wsgi.process_group': '',
> >  'mod_wsgi.reload_mechanism': '0',
> >  'mod_wsgi.script_reloading': '1',
> >  'mod_wsgi.version': (2, 8),
> >  'wsgi.errors': <mod_wsgi.Log object at 0x7f455fa71de0>,
> >  'wsgi.file_wrapper': <built-in method file_wrapper of
> > mod_wsgi.Adapter object at 0x7f455fc9e198>,
> >  'wsgi.input': <mod_wsgi.Input object at 0x7f455fc8f670>,
>
> >  'wsgi.multiprocess': True,
> >  'wsgi.multithread': True,
> >  'wsgi.run_once': False,
> >  'wsgi.url_scheme': 'http',
> >  'wsgi.version': (1, 0)}>
>
> > There is a particular condition that is causing livesettings to not
> > find SHOP as defined, and if I go towww.my_test_site.com/settingsit
> > may or may not error out. It appears to be a race condition of some
> > sort. Sadly, I cannot reproduce the bug unless I hit it with a high
> > load. In those situations, I can get a smaller subset of the requests
> > as errors - and it can happen in any page, but the stack trace is the
> > same.
>
> > I tried different version of django-livesettings. I have tried django-
> > livesettings-1-4-7 and 1-4-9
>
> > Any pointers as to what may cause fetching the settings fail under
> > high load?
>
> > Thanks,
>
> > - Ragi

-- 
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en.

Reply via email to