unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Marc Sernatinger <marc@vailsys.com>
To: mongrel-unicorn@rubyforge.org
Subject: SQL Server errors when using unicorn
Date: Fri, 8 Jul 2011 13:30:23 -0500	[thread overview]
Message-ID: <09EC48D7-7E0E-43E3-9B42-641E045CF7D8@vailsys.com> (raw)

Lately I have been seeing a large volume of database errors in a couple of applications at work.  This has proven difficult to troubleshoot: after some restarts of unicorn, things seem fine.   Then, a restart as part of a new deployment introduces these issues anew, with rollback to the previous version of the app still producing errors.  

One thing I have noticed is in my troubleshooting is that I seem to be able to reproduce these errors only after a period of idleness or low activity on the part of unicorn.  Running unicorn on my workstation, running ab with a concurrency of 5 or so is enough to produce the issue reasonably often.  

I bring this question to the unicorn discussion because I noticed we don't have this problem using Passenger.  I was wondering if there were any particulars of our setup that seem problematic. 

Here is an example of the error we see.  It is not always exactly this error.  Sometimes we will see a bad token error from SQL Server.  Other times the error manifests itself in ActiveRecord dynamic methods not being properly created:

[ WARN 11-07-08 11:42:29 25300:0x1001d6360 ] Internal Server Error ODBC::Error: 01000 (20017) [unixODBC][FreeTDS][SQL Server]Unexpected EOF from the server:  SELECT columns.TABLE_NAME as table_name, columns.COLUMN_NAME as name, columns.DATA_TYPE as type, columns.COLUMN_DEFAULT as default_value, columns.NUMERIC_SCALE as numeric_scale, columns.NUMERIC_PRECISION as numeric_precision, CASE WHEN columns.DATA_TYPE IN ('nchar','nvarchar') THEN columns.CHARACTER_MAXIMUM_LENGTH ELSE COL_LENGTH(columns.TABLE_SCHEMA+'.'+columns.TABLE_NAME, columns.COLUMN_NAME) END as length, CASE WHEN columns.IS_NULLABLE = 'YES' THEN 1 ELSE NULL END as is_nullable, CASE WHEN COLUMNPROPERTY(OBJECT_ID(columns.TABLE_SCHEMA+'.'+columns.TABLE_NAME), columns.COLUMN_NAME, 'IsIdentity') = 0 THEN NULL ELSE 1 END as is_identit
 y FROM INFORMATION_SCHEMA.COLUMNS columns WHERE columns.TABLE_NAME = 'users' AND columns.TABLE_SCHEMA = schema_name() ORDER BY columns.ordinal_position 


Our stack:
Rails 3.0.7 
activerecord-sqlserver-adapter 3.0.15 using ruby-odbc and FreeTDS 0.82 
unicorn 3.5.0 with nginx in front 
SQL Server 2005 -- at a different site from our web servers, connected by WAN
CentOS 5.9

I appreciate any suggestions as to where the problem may lie. 

Thanks

_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


             reply	other threads:[~2011-07-08 18:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-08 18:30 Marc Sernatinger [this message]
2011-07-11  8:11 ` SQL Server errors when using unicorn Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=09EC48D7-7E0E-43E3-9B42-641E045CF7D8@vailsys.com \
    --to=marc@vailsys.com \
    --cc=mongrel-unicorn@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).