users@glassfish.java.net

Re: Problem with Native deployment of ruby on rails application on glassfi

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Tue, 12 Jan 2010 10:03:00 -0800

[There are multiple postings with your userid, however content look
formatted different. Maybe its java.net issue. ]

As you noted the delay is coming from ActiveRecord/DB adapter. So I
tried depot application with jdbcsqlite3 adapter and inserted the same
code in my store#index controller.

Mongrel:

2010/01/12 09:41:36.654000 -0800
2010/01/12 09:41:37.70000 -0800

glassfish v3:

[#|2010-01-12T09:48:49.888-0800|INFO|glassfishv3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=http-thread-pool-8080-(1);|2010/01/12
09:48:49.888000 -0800|#]

[#|2010-01-12T09:48:49.960-0800|INFO|glassfishv3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=http-thread-pool-8080-(1);|2010/01/12
09:48:49.959000 -0800|#]


As you can see its about the same time. So I dont see any delay here.

-vivek.



 


glassfish_at_javadesktop.org wrote:
> Thank you your suggestion, Itried glassfish gem deployment, it works as well as webrick.
>
> However, the performance problem of jruby + glassfish v3 seems still there. As you mentioned, this may be not caused by glassfishv3. Finally, I find this problem may lie in the different operations of ActionRecord between WEBrick and glassfishv3. I did the following test:
>
> Application environment:
>
> Server:WEBrick1.3.1
> Database:Oracle 11g
> Ruby version 1.8.7 (java)
> RubyGems version 1.3.5
> Rack version 1.0
> Rails version 2.3.4
> Active Record version 2.3.4
> Active Resource version 2.3.4
> Action Mailer version 2.3.4
> Active Support version 2.3.4
> Application root C:/Documents and Settings/Administrator/My Documents/NetBeansProjects/RailsApplication1
> Environment development
> Database adapter oracle_enhanced
> Database schema version 20100110051408
>
> View:
> <h1>TestSession#index</h1>
> <p>Find me in app/views/test_session/index.html.erb</p>
>
> Controller:
>
> class TestSessionController < ApplicationController
> def index
>
> puts Time.now.strftime("%Y/%m/%d %H:%M:%S.#{Time.now.usec} %z")
> @blog=Blog.new
> puts Time.now.strftime("%Y/%m/%d %H:%M:%S.#{Time.now.usec} %z")
>
> end
> end
>
> Model:
> class Blog < ActiveRecord::Base
> end
>
> After run the application on WEBrick and access the controller http://localhost:3000/test_session
>
> the console outputs the following information:
>
> 2010/01/12 14:52:50.531000 +0800
> 2010/01/12 14:52:50.953000 +0800
>
> Now I change the server to glassfish v3, and access the controller with
> http://localhost/RailsApplication1/test_session
>
> I get the following information:
>
> 信息: Processing TestSessionController#index (for 127.0.0.1 at 2010-01-12 15:00:31) [GET]
>
> 信息: 2010/01/12 15:00:31.859000 +0800
> 信息:
> 信息: SQL (16.0ms) SELECT trigger_name
> FROM all_triggers
> WHERE owner = 'RUBY'
> AND trigger_name = 'BLOGS_PKT'
> AND table_owner = 'RUBY'
> AND table_name = 'BLOGS'
> AND status = 'ENABLED'
>
>
> 信息: Blog Columns (0.0ms) select column_name as name, data_type as sql_type, data_default, nullable,
> decode(data_type, 'NUMBER', data_precision,
> 'FLOAT', data_precision,
> 'VARCHAR2', decode(char_used, 'C', char_length, data_length),
> 'CHAR', decode(char_used, 'C', char_length, data_length),
> null) as limit,
> decode(data_type, 'NUMBER', data_scale, null) as scale
> from all_tab_columns
> where owner = 'RUBY'
> and table_name = 'BLOGS'
> order by column_id
>
>
> 信息: 2010/01/12 15:00:33.859000 +0800
> 信息:
> 信息: Rendering test_session/index
>
> 信息: Completed in 3000ms (View: 1000, DB: 16) | 200 OK [http://localhost/RailsApplication1/test_session]
>
> The execute time of glassfish is much longer than Webrick, I am really curious why there are such big difference in executing only a simple line of code?
> [Message sent by forum member 'hitwzh' (hitwzh_at_gmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=380231
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>