Browse Source

Use persistent connection.

INADA Naoki 12 years ago
parent
commit
2a582bcedd
2 changed files with 4 additions and 3 deletions
  1. 2 1
      django-stripped/hello/hello/settings.py
  2. 2 2
      django/hello/hello/settings.py

+ 2 - 1
django-stripped/hello/hello/settings.py

@@ -15,8 +15,9 @@ DATABASES = {
         'NAME': 'hello_world',                      # Or path to database file if using sqlite3.
         'NAME': 'hello_world',                      # Or path to database file if using sqlite3.
         'USER': 'benchmarkdbuser',                      # Not used with sqlite3.
         'USER': 'benchmarkdbuser',                      # Not used with sqlite3.
         'PASSWORD': 'benchmarkdbpass',                  # Not used with sqlite3.
         'PASSWORD': 'benchmarkdbpass',                  # Not used with sqlite3.
-        'HOST': 'localhost',                      # Set to empty string for localhost. Not used with sqlite3.
+        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
+        'CONN_MAX_AGE': 30,
     }
     }
 }
 }
 
 

+ 2 - 2
django/hello/hello/settings.py

@@ -11,13 +11,13 @@ MANAGERS = ADMINS
 
 
 DATABASES = {
 DATABASES = {
     'default': {
     'default': {
-        'ENGINE': 'django_psycopg2_pool.gevent', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
+        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
         'NAME': 'hello_world',                      # Or path to database file if using sqlite3.
         'NAME': 'hello_world',                      # Or path to database file if using sqlite3.
         'USER': 'benchmarkdbuser',                      # Not used with sqlite3.
         'USER': 'benchmarkdbuser',                      # Not used with sqlite3.
         'PASSWORD': 'benchmarkdbpass',                  # Not used with sqlite3.
         'PASSWORD': 'benchmarkdbpass',                  # Not used with sqlite3.
         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
-	'POOL_SIZE' : 32,
+        'CONN_MAX_AGE': 30,
     }
     }
 }
 }