[google-appengine] Re: Huge time difference for serving the same request

2013-09-14 Thread timh


On Saturday, September 14, 2013 2:57:35 PM UTC+8, aswath wrote:
>
> If a request a served by an instance that is alive for sometime, then it 
> is fine.
> However, sometimes the request is directed to a new instance. Any first 
> request for a new instance is adding a considerable delay.
>
>
This implies you have some control over the performance.  As I said earlier 
either it's something that is expensive to initialise and is not occurring 
as part of the warmup request
or you are caching something expensive as a result of the first request 
serviced by the instance.  

I would strongly recommend you us appstats and logging, and determine where 
in your request processing the time is consumed on this initial request - 
maybe you can get whatever it does performed as part of a warmup request.

T

 

> -Aswath
>
>
> On Sat, Sep 14, 2013 at 10:50 AM, timh >wrote:
>
>> I would check that this is always the case. Also check what 3rd and 4th 
>> request is like - make sure it's the same instance.
>>
>>  If so it would then suggest that additional initialisation is being 
>> performed that is expensive  or that caching of some data (memcache for 
>> instance) has a significant performance impact (improvement)  for 2nd and 
>> subsequent requests.  
>>
>> You should use appstats to profile what this request is doing.
>>
>> T
>>
>>
>> On Saturday, September 14, 2013 1:05:49 PM UTC+8, aswath wrote:
>>
>>> I am attaching the new logs.
>>>
>>> I was examining the logs.  It did not say, it started a new instance.   
>>> But, there was a instance startup before that log 
>>> /_ah/warmup 200 15380ms 0kb 
>>>
>>> I noticed that the request that is taking longer  was served by the 
>>> newly started instance.
>>>
>>>
>>> -Aswath
>>>
>>>
>>>
>>> On Sat, Sep 14, 2013 at 9:48 AM, timh  wrote:
>>>
 You truncated the log for the 4159ms request.  Did it say it started a 
 new instance ?

 T


 On Saturday, September 14, 2013 11:15:37 AM UTC+8, aswath wrote:
>
> Hello,
> I am finding a huge time difference for serving the same request. 
>  Attached is the logs that shows the serving time for the same request.
> The same request was accessed with in 1 min interval from the same 
> browser.  There is no business logic change that happens between the 
> first 
> 1st request and the 2nd request.
>
> For the first request the serving the time is 4159ms, and for the 
> second request it is 832ms.  Why is this huge time difference?
>
> -Aswath
>
>
>>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


[google-appengine] Organizing webapp2 application

2013-09-14 Thread diego
Im trying to find the right way to organize my webapp2 application. This is
the file structure:

/my-app
app.yaml
main.app
/views
index.html
/handlers
__init__.py
base.py
home.py

handlers/base.py

import webapp2from webapp2_extras import jinja2
class BaseHandler(webapp2.RequestHandler):

@webapp2.cached_property
def jinja2(self):
return jinja2.get_jinja2(app=self.app)

def render_response(self, _template, **context):
rendered_template = self.jinja2.render_template(_template +
'.html', **context)
return self.response.write(rendered_template)

All the handlers extends the BaseHandler

handlers/home.py

from base import BaseHandler# Not sure about importing BaseHandler here
class Name(BaseHandler):

def post(self, name=None):

context = {
'name': name,
}

self.render_response('index', **context)

and this is the main.py file

import osimport webapp2from webapp2_extras import jinja2

CONFIG = {
'debug': True,
'webapp2_extras.jinja2': {
'autoescape': True,
'template_path': os.path.join(os.path.dirname(__file__), 'views'),
'globals': {
'url_for': webapp2.uri_for,
},
},}

app = webapp2.WSGIApplication([
webapp2.Route('/', handler='handlers.home.Name
', name='name'),], config = CONFIG, debug
= CONFIG['debug'])

Should I put the routes in the same file? Because all the handlers extends
the BaseHandler i´m not sure if that is the right way to do that. Also I´m
importing webapp2 and extras twice.

thx for the advice

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


[google-appengine] Python 2.5 and Master Slave Datastore

2013-09-14 Thread jay
How long do I have before I have to update my new app to python 2.7 and the 
new db? Is there a specified date when my old app will no longer function?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [google-appengine] Python 2.5 and Master Slave Datastore

2013-09-14 Thread Barry Hunter
Why wait? Update now. Just do it. Don't waste time thinking if you should
be updating, when you could actully be using that time updating!


Why run the risk that it could be turned off at any time with little
warning. (although I expect they will always try to give some warning)

In theory the deprecation policy, means features will be available until April
20, 2015, BUT Google can for its own reasons to end features sooner than
that.





On 14 September 2013 21:04, jay  wrote:

> How long do I have before I have to update my new app to python 2.7 and
> the new db? Is there a specified date when my old app will no longer
> function?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-appengine+unsubscr...@googlegroups.com.
> To post to this group, send email to google-appengine@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-appengine.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [google-appengine] Python 2.5 and Master Slave Datastore

2013-09-14 Thread jay
Becuase time is money and in April 2015 I might be able to just retire the 
app instead of doing the work. 

I'm busy you know!

On Sunday, 15 September 2013 06:32:57 UTC+10, barryhunter wrote:
>
> Why wait? Update now. Just do it. Don't waste time thinking if you should 
> be updating, when you could actully be using that time updating!
>
>
> Why run the risk that it could be turned off at any time with little 
> warning. (although I expect they will always try to give some warning) 
>
> In theory the deprecation policy, means features will be available until 
> April 
> 20, 2015, BUT Google can for its own reasons to end features sooner than 
> that. 
>
>
>
>
>
> On 14 September 2013 21:04, jay > wrote:
>
>> How long do I have before I have to update my new app to python 2.7 and 
>> the new db? Is there a specified date when my old app will no longer 
>> function?
>>  
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Google App Engine" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-appengi...@googlegroups.com .
>> To post to this group, send email to 
>> google-a...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/google-appengine.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


[google-appengine] Re: Huge time difference for serving the same request

2013-09-14 Thread Aswath Satrasala
I do some performance stuff, but that will save me only 200-300ms.  Other
that that, no special code is in the servlets.

Following are debug logs that take 4038ms and 235ms for the same request.

Please find the code that happens between "LoginFilter Begin" and "before
chain.doFilter()".
In the below log, the log between "7" and "7a" is taking about 1.5 secs.
 It is just one query that happens there.
 Most of the calls are taking longer time in the first request.
http://snipt.org/AgjF0



   1. 2013-09-15 07:32:34.625 /toolsMgr/activityLog?tenantId=
   DemoCompany:veersoft1.t...@gmail.com&branchId=5270096&timePeriodId=16001
   200 4038ms 22kb Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0)
   Gecko/20100101 Firefox/23.0
   2. I2013-09-15 07:32:30.619
com.veersoft.filter.ResetUserMessagesAndErrorsFilter
   doFilter: begin
   3. I2013-09-15 07:32:30.619 com.veersoft.filter.LoginFilter doFilter:
   LoginFilter Begin
   4. I2013-09-15 07:32:30.625 com.veersoft.filter.LoginFilter doFilter: 1
   5. I2013-09-15 07:32:30.643 com.veersoft.filter.LoginFilter doFilter: 2
   6. I2013-09-15 07:32:31.036 com.veersoft.filter.LoginFilter doFilter: 3
   7. I2013-09-15 07:32:31.036 com.veersoft.filter.LoginFilter doFilter: 4
   8. I2013-09-15 07:32:31.039 com.veersoft.filter.LoginFilter doFilter: 5
   9. I2013-09-15 07:32:31.116 com.veersoft.filter.LoginFilter doFilter: 6
   10. I2013-09-15 07:32:31.117 com.veersoft.filter.LoginFilter doFilter: 7
   11. I2013-09-15 07:32:31.117 com.veersoft.filter.LoginFilter doFilter: 7a
   12. I2013-09-15 07:32:32.732 com.veersoft.filter.LoginFilter doFilter: 8
   13. I2013-09-15 07:32:32.732 com.veersoft.filter.LoginFilter doFilter: 9
   14. I2013-09-15 07:32:32.732 com.veersoft.filter.LoginFilter doFilter: 10
   15. I2013-09-15 07:32:32.732 com.veersoft.filter.LoginFilter doFilter:
   before chain.doFilter()
   16. I2013-09-15 07:32:32.733
com.veersoft.common.servlet.ValidateTenantServlet
   doGet: LoginInterceptor: user logged in = accguru1.t...@gmail.com
   17. I2013-09-15 07:32:32.733
com.veersoft.common.servlet.ValidateTenantServlet
   validateTenant: Validating tenant
DemoCompany:veersoft1.test@gmail.comfor user accguru1.test@gmail.
   18. I2013-09-15 07:32:32.841
com.veersoft.common.servlet.ValidateTenantServlet
   validateTenant: tenant size list = 0
   19. I2013-09-15 07:32:32.841
com.veersoft.common.servlet.ValidateTenantAndBranchServlet
   validateBranch: branchId validated value is : 5270096
   20. I2013-09-15 07:32:33.519
com.veersoft.common.servlet.MainMenuMgrBaseServlet
   doGet: The memcahce key in main Servlet for headerAndMenu
   accguru1.test@gmail.comDemoCompany-veerso
   21. I2013-09-15 07:32:33.800
com.veersoft.common.servlet.MainMenuMgrBaseServlet
   cacheHeaderAndMenusForMenuLink: Getting the prepared header and menu cache
   22. I2013-09-15 07:32:34.616 com.veersoft.filter.LoginFilter doFilter:
   /toolsMgr/activityLog: 3997ms
   23. I2013-09-15 07:32:34.616
com.veersoft.filter.ResetUserMessagesAndErrorsFilter
   doFilter: end



   1. 2013-09-15 07:26:12.898 /toolsMgr/activityLog?tenantId=
   DemoCompany:veersoft1.t...@gmail.com&branchId=5270096&timePeriodId=16001
   200 235ms 22kb Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0)
   Gecko/20100101 Firefox/23.0
   2. I2013-09-15 07:26:12.683
com.veersoft.filter.ResetUserMessagesAndErrorsFilter
   doFilter: begin
   3. I2013-09-15 07:26:12.683 com.veersoft.filter.LoginFilter doFilter:
   LoginFilter Begin
   4. I2013-09-15 07:26:12.683 com.veersoft.filter.LoginFilter doFilter: 1
   5. I2013-09-15 07:26:12.684 com.veersoft.filter.LoginFilter doFilter: 2
   6. I2013-09-15 07:26:12.687 com.veersoft.filter.LoginFilter doFilter: 3
   7. I2013-09-15 07:26:12.687 com.veersoft.filter.LoginFilter doFilter: 4
   8. I2013-09-15 07:26:12.688 com.veersoft.filter.LoginFilter doFilter: 5
   9. I2013-09-15 07:26:12.695 com.veersoft.filter.LoginFilter doFilter: 6
   10. I2013-09-15 07:26:12.696 com.veersoft.filter.LoginFilter doFilter: 7
   11. I2013-09-15 07:26:12.696 com.veersoft.filter.LoginFilter doFilter: 7a
   12. I2013-09-15 07:26:12.708 com.veersoft.filter.LoginFilter doFilter: 8
   13. I2013-09-15 07:26:12.708 com.veersoft.filter.LoginFilter doFilter: 9
   14. I2013-09-15 07:26:12.708 com.veersoft.filter.LoginFilter doFilter: 10
   15. I2013-09-15 07:26:12.708 com.veersoft.filter.LoginFilter doFilter:
   before chain.doFilter()
   16. I2013-09-15 07:26:12.709
com.veersoft.common.servlet.ValidateTenantServlet
   doGet: LoginInterceptor: user logged in = accguru1.t...@gmail.com
   17. I2013-09-15 07:26:12.709
com.veersoft.common.servlet.ValidateTenantServlet
   validateTenant: Validating tenant
DemoCompany:veersoft1.test@gmail.comfor user accguru1.test@gmail.
   18. I2013-09-15 07:26:12.720
com.veersoft.common.servlet.ValidateTenantServlet
   validateTenant: tenant size list = 0
   19. I2013-09-15 07:26:12.720
com.veersoft.common.servlet.ValidateTenantAndBranchServlet
   validateBranch: branchId validated value is : 5270096
   20

[google-appengine] appstats not displaying the remoteapi calls made from the Servlet filters

2013-09-14 Thread Aswath Satrasala
Hello,
I noticed that appstats do not display the data for the calls originating
from servlet filters.
Is this true, or should I enable any settings to see the data from the
servlet filters.

-Aswath

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


[google-appengine] Currently experiencing frequent DeadlineExceededExceptions when it was fine a few hours ago.

2013-09-14 Thread Eurig Jones
Is anyone else experiencing this? My app ID is chesspresso-service and 
since the early hours of this morning it's been hitting these over and over 
again..


   1. 
   
   1. 2013-09-15 09:15:08.976
  
  Failed startup of context 
com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@194d72e{/,/base/data/home/apps/s~chesspresso-service/8.370218489431632893}
  com.google.apphosting.api.DeadlineExceededException: This request 
(2dd156b0a6c4d17b) started at 2013/09/15 06:14:08.061 UTC and was still 
executing at 2013/09/15 06:15:07.583 UTC.
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:227)
at java.util.zip.ZipFile.(ZipFile.java:156)
at java.util.jar.JarFile.(JarFile.java:153)
at java.util.jar.JarFile.(JarFile.java:90)
at sun.misc.URLClassPath$JarLoader.getJarFile(URLClassPath.java:963)
at sun.misc.URLClassPath$JarLoader.access$900(URLClassPath.java:752)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:897)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:890)
at java.security.AccessController.doPrivileged(Native Method)
at 
sun.misc.URLClassPath$JarLoader.ensureOpenSynchronized(URLClassPath.java:889)
at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:881)
at sun.misc.URLClassPath$JarLoader.(URLClassPath.java:817)
at sun.misc.URLClassPath$JarLoader.(URLClassPath.java:774)
at sun.misc.URLClassPath$3.run(URLClassPath.java:423)
at sun.misc.URLClassPath$3.run(URLClassPath.java:407)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:406)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:382)
at sun.misc.URLClassPath.findResource(URLClassPath.java:208)
at java.net.URLClassLoader$2.run(URLClassLoader.java:551)
at java.net.URLClassLoader$2.run(URLClassLoader.java:549)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findResource(URLClassLoader.java:548)
at 
com.google.apphosting.runtime.security.UserClassLoader.findResource(UserClassLoader.java:723)
at java.lang.ClassLoader.getResource(ClassLoader.java:1141)
at org.mortbay.resource.Resource.newSystemResource(Resource.java:203)
at 
org.mortbay.jetty.webapp.WebXmlConfiguration.configureDefaults(WebXmlConfiguration.java:159)
at 
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1230)
at 
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at 
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:219)
at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:194)
at 
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
at 
com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:439)
at 
com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:435)
at 
com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:442)
at 
com.google.tracing.CurrentContext.runInContext(CurrentContext.java:186)
at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:306)
at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:298)
at 
com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:439)
at 
com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
at java.lang.Thread.run(Thread.java:722)
  
  2. C2013-09-15 09:15:08.993
  
  Uncaught exception from servlet
  javax.servlet.UnavailableException: Initialization failed.
at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:228)
at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:194)
at 
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
at 
com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:439)
at 
com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:435)
at 
com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:442)
at 
com.google.tracing.CurrentContext.runInContext(CurrentContext.java:186)
at 
com.google.tracing.TraceContext$Abstra