Hi,
We've tested a couple of things on the askbot staging instance that I think could really improve the performance of askfedora:
1. Use python-django-post_office as email back end[1]: We run a cron job to send out mails periodically using post-office asynchronously. This reduces the delay in comment posting and operations quite a bit.
2. Send periodic reminders to request people to accept the best answer for questions they've asked.[2] This should hopefully reduce the number of "unanswered" questions on the forum, specially questions that have been answered but no answer accepted.
The changes are minor ones and could wait for the freeze to finish, but I expect them to improve usability quite a bit. What do you folks think?
[1] https://fedorahosted.org/fedora-infrastructure/ticket/3763 [2] https://fedorahosted.org/fedora-infrastructure/ticket/3762
Apart from the puppet changes below, the ask production database will have to be updated to include python-post-office as explained here[3].
[3] https://pypi.python.org/pypi/django-post_office
Puppet changes:
diff --git a/modules/askbot/manifests/init.pp b/modules/askbot/manifests/init.pp index 98afdb0..0c6e01e 100644 --- a/modules/askbot/manifests/init.pp +++ b/modules/askbot/manifests/init.pp @@ -26,11 +26,8 @@ class askbot { package { "python-psycopg2": ensure => present } - if $puppetEnvironment == 'staging' { - # cron job for reminders: #3762 - package { "django-post_office": - ensure => present - } + package { "django-post_office": + ensure => present } fedmsg::certificate { "askbot": service => "askbot", @@ -76,19 +73,17 @@ class askbot { target => '/usr/lib/python2.6/site-packages/askbot/static/admin/', }
- if $puppetEnvironment == 'staging' { - file { "/etc/cron.d/cron-ask-send-reminders": - owner => "root", - group => "root", - mode => 0644, - source => "puppet:///askbot/cron-ask-send-reminders", - } - file { "/etc/cron.d/cron-post-office-send-mail": - owner => "root", - group => "root", - mode => 0644, - source => "puppet:///askbot/cron-post-office-send-mail" - } + file { "/etc/cron.d/cron-ask-send-reminders": + owner => "root", + group => "root", + mode => 0644, + source => "puppet:///askbot/cron-ask-send-reminders", + } + file { "/etc/cron.d/cron-post-office-send-mail": + owner => "root", + group => "root", + mode => 0644, + source => "puppet:///askbot/cron-post-office-send-mail" }
exec { 'askbot_collectstatic': diff --git a/modules/askbot/templates/settings.erb b/modules/askbot/templates/settings.erb index f04615a..3dc543a 100644 --- a/modules/askbot/templates/settings.erb +++ b/modules/askbot/templates/settings.erb @@ -37,10 +37,7 @@ EMAIL_SUBJECT_PREFIX = '' EMAIL_HOST='bastion' EMAIL_PORT='25' EMAIL_USE_TLS=False -EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' -<% if environment == "staging" %> EMAIL_BACKEND = 'post_office.EmailBackend' -<% end %>
#incoming mail settings #after filling out these settings - please @@ -187,9 +184,7 @@ INSTALLED_APPS = ( #'followit', # 'avatar', #requires setting of MEDIA_ROOT and MEDIA_URL -<% if environment == "staging" %> 'post_office', -<% end %> )
MEDIA_ROOT='/var/lib/askbot/upfiles/ask'
On Fri, 24 May 2013 00:27:08 +1000 Ankur Sinha sanjay.ankur@gmail.com wrote:
Hi,
We've tested a couple of things on the askbot staging instance that I think could really improve the performance of askfedora:
- Use python-django-post_office as email back end[1]:
We run a cron job to send out mails periodically using post-office asynchronously. This reduces the delay in comment posting and operations quite a bit.
- Send periodic reminders to request people to accept the best answer
for questions they've asked.[2] This should hopefully reduce the number of "unanswered" questions on the forum, specially questions that have been answered but no answer accepted.
The changes are minor ones and could wait for the freeze to finish, but I expect them to improve usability quite a bit. What do you folks think?
[1] https://fedorahosted.org/fedora-infrastructure/ticket/3763 [2] https://fedorahosted.org/fedora-infrastructure/ticket/3762
Apart from the puppet changes below, the ask production database will have to be updated to include python-post-office as explained here[3].
I'm ok with this given it's all working in stg.
+1 here.
kevin
On Thu, May 23, 2013 at 10:42:06AM -0600, Kevin Fenzi wrote:
On Fri, 24 May 2013 00:27:08 +1000 Ankur Sinha sanjay.ankur@gmail.com wrote:
Hi,
We've tested a couple of things on the askbot staging instance that I think could really improve the performance of askfedora:
- Use python-django-post_office as email back end[1]:
We run a cron job to send out mails periodically using post-office asynchronously. This reduces the delay in comment posting and operations quite a bit.
- Send periodic reminders to request people to accept the best answer
for questions they've asked.[2] This should hopefully reduce the number of "unanswered" questions on the forum, specially questions that have been answered but no answer accepted.
The changes are minor ones and could wait for the freeze to finish, but I expect them to improve usability quite a bit. What do you folks think?
[1] https://fedorahosted.org/fedora-infrastructure/ticket/3763 [2] https://fedorahosted.org/fedora-infrastructure/ticket/3762
Apart from the puppet changes below, the ask production database will have to be updated to include python-post-office as explained here[3].
I'm ok with this given it's all working in stg.
+1 here.
Given that askbot isn't critical to getting a release out the only part that worries me is the database update.
if it's tested in stg, sounds okay to me, though.
-Toshio
On Thu, 2013-05-23 at 11:59 -0700, Toshio Kuratomi wrote:
Given that askbot isn't critical to getting a release out the only part that worries me is the database update.
if it's tested in stg, sounds okay to me, though.
Yep. I was worried that the database update might explode, but it seemed to work just right on the staging server so I wouldn't expect it to be any different over on the production one. I won't know until I try it out though.
I could backup the db, just to be on the safe side. Is there a fixed method infra follows for db backups (django db in this case)?
On Fri, May 24, 2013 at 12:27:16PM +1000, Ankur Sinha wrote:
On Thu, 2013-05-23 at 11:59 -0700, Toshio Kuratomi wrote:
Given that askbot isn't critical to getting a release out the only part that worries me is the database update.
if it's tested in stg, sounds okay to me, though.
Yep. I was worried that the database update might explode, but it seemed to work just right on the staging server so I wouldn't expect it to be any different over on the production one. I won't know until I try it out though.
I could backup the db, just to be on the safe side. Is there a fixed method infra follows for db backups (django db in this case)?
Probably just jump into #fedora-admin and see if there's someone about who can dump the db. Since it's on the postgres server, it needs a sysadmin-main that can log onto db01 and run something like this:
sudo -u postgres pg_dump -C $DBNAME |xz -2 > $DBNAME-$(date --rfc-3339=date).dump.xz
Note that the db will be consistent with a dump like this but we can't guarantee that the app will be consistent (if the app doesn't use transactions at appropriate places it could perform half of an action). For that you'd also have to shut down ask before the db is dumped.
-Toshio
infrastructure@lists.fedoraproject.org