[appengine-java] Re: calling backend servlet from a corn job servlet

2011-10-23 Thread Peter Dev
?xml version=1.0 encoding=UTF-8?
cronentries
  cron
url/long-task/url
description/description
scheduleevery 30 minutes/schedule
targetname-of-the-backend/target
  /cron
/cronentries






On Oct 20, 4:16 am, fachhoch fachh...@gmail.com wrote:
 I have a heavy duty servlet whihc takes long time to run , so I added
 a   backed.xml and want to call this servlet through  a corn job
 servlet  , please tell me how to call the backend from a corn job?

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: calling backend servlet from a corn job servlet

2011-10-23 Thread Peter Dev
http://www.pdjamez.com/2011/05/google-app-engine-backends-part-deux/





On Oct 23, 5:42 pm, Peter Dev dev133...@gmail.com wrote:
 ?xml version=1.0 encoding=UTF-8?
 cronentries
   cron
     url/long-task/url
     description/description
     scheduleevery 30 minutes/schedule
     targetname-of-the-backend/target
   /cron
 /cronentries

 On Oct 20, 4:16 am, fachhoch fachh...@gmail.com wrote:







  I have a heavy duty servlet whihc takes long time to run , so I added
  a   backed.xml and want to call this servlet through  a corn job
  servlet  , please tell me how to call the backend from a corn job?

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] DB API read Quota vs. sessions-enabled true

2011-10-03 Thread Peter Dev
 sessions-enabledtrue/sessions-enabled
App Engine stores session data in the datastore and memcache, all
values stored in the session must implement the java.io.Serializable
interface.

in java session.getAttribute(XY) calls Datastore API READ if data in
Memcache not found?  (free limit 50K/24hour)
Thx.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: GAE - Vote counting system

2011-09-30 Thread Peter Dev
After each vote we want to send back the actual state of voted object
(actual votes)... so, we need to store the number of votes and not
only the deltas.
Actual state of the votes we could store in backends cache, and in
batch write changes in db.
What do you think about this solution?
I appreciate your answers! Thx

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: GAE - Vote counting system

2011-09-29 Thread Peter Dev
Price:
- with backends lets say 3 B2 machines = 350USD/Month
- UrlFetch Data Sent/Received 0,15USD/GB

Limit:
- URL Fetch Daily Limit 46,000,000 calls
  this can be a problem...but I see it is possible to request an
increase

Write data parallel in DB: Task Queue with rate every 30second could
be a solution
(check timestamps in cache and write in DB)

RESET counters = empty cache in Backends  reset counter of object in
DB

Backends cache = HashMap with shared counter values
or
counter values without sharding
(just increment value in java hashmap is fast enough)

With backends we don’t need sharding I thinkwhat do you think? Thx.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: GAE - Vote counting system

2011-09-27 Thread Peter Dev
Shared counter is cool and I use it... but if you have millions of
objects I cannot imagine how to manage them.
1 000 000 obj x 100 shards = 10 000 000 counters

1. How to reset them to 0 in specified periods?
2. How to set the shared sum for each object to show top 100 objects?
3. Too much DB API Calls (each vote makes write in DB)

Any ideas...? Thx

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: GAE - Vote counting system

2011-09-27 Thread Peter Dev
Sorry, 100 000 000 counters

On Sep 27, 4:53 pm, Peter Dev dev133...@gmail.com wrote:
 Shared counter is cool and I use it... but if you have millions of
 objects I cannot imagine how to manage them.1 000 000obj x 100 shards =10 000 
 000counters

 1. How to reset them to 0 in specified periods?
 2. How to set the shared sum for each object to show top 100 objects?
 3. Too much DB API Calls (each vote makes write in DB)

 Any ideas...? Thx

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Using async-session-persistence

2011-09-26 Thread Peter Dev
http://code.google.com/appengine/articles/managing-resources.html

For Java HTTP sessions, write asynchronously - HTTP sessions (Java)
lets you configure your application to asynchronously write http
session data to the datastore by adding async-session-persistence
enabled=true/ to your appengine-web.xml.

but parameter 'queue-name'
is required! :-)

















On Sep 3, 8:53 pm, John supp...@weespr.com wrote:
 http://code.google.com/p/googleappengine/issues/detail?id=5774

 Star it

 On Aug 30, 7:28 pm, Spines kwste...@gmail.com wrote:







  I'm getting this same error after enablingasync-session-persistence,
  except 100% of the time. It shows this error in the logs:

  javax.servlet.ServletContext log: _ah_queue_deferred: Deferred task
  failed exception:
  com.google.apphosting.utils.servlet.DeferredTaskServlet
  $DeferredTaskException: java.lang.ClassNotFoundException:
  com.google.apphosting.runtime.jetty.DeferredDatastoreSessionStore
  $DeferredSave

  Any ideas?

  On Aug 1, 7:34 am, gk goran.kar...@googlemail.com wrote:

   Greetings,

   still have not found any clues what could cause async-session-  
   persistence tasks to fail with HTTP status code 415 (Unsupported
   Media Type).

   Any ideas?

   On Jul 27, 9:16 pm, gk goran.kar...@googlemail.com wrote:

I am experimenting with async-session-persistenceenabled=true
queue-name=default/ to store https session data; at first it seems
to work fine with the default default queue settings; multithreading
is switched on for the application.

It appears that there is some kind of collision, as the tasks seem to
succeed when the rate of incoming requests is low.

When I open a browser window and reload 50 pages from the site at once
it seems to work fine and the queue is filled up with some tasks. Most
ot the tasks succeed.

The problem is that around 30% of the async-session-persistence
tasks fail repeatedly with HTTP status code 415 (Unsupported Media
Type) and there is no further indication of the cause in the queue or
in the server log.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] GAE - Vote counting system

2011-09-26 Thread Peter Dev
We are developing an application, where users can vote for many
objects.
(for example, voting the best music video of the week)

- This means, we have millions of possible objects to vote for, and
millions of users

To our best knowledge, after taking in consideration different
options, the best (or the only) voting system is: Memcache+Bulk DB
write in DB
- If number of objects in Memcache will achieve a specified limit (for
example 3000) then write in DB.

The writing speed into DB is about 100/sec. This also means, if we
would set the above mentioned 3000 objects, the writing would last for
30 sec...

The problem; during save in DB, voting must be blocked. In other
words, if from many millions of objects, there are 3000 achieved voted
objects, we need to write it into DB and it can happen too many times,
and blocking the whole voting mechanism.

If we do not block the voting whilst writing in DB, the result could
be wrong number of votes from cache (see Workflow: step 3).

Workflow:

1. vote received
2. find object in memcache
3. if not found in memcache get from DB and put it in
4. increment the number of votes of the object in memcache
5. check object number in memcache
6. if necessary, save in DB and empty memcache
...

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Datastore APIs new pricing - Query (FirstResult/MaxResults)

2011-09-26 Thread Peter Dev
Datastore APIs new pricing - Query (FirstResult/MaxResults)

http://code.google.com/appengine/kb/postpreviewpricing.html#two_entities_fetched_operations_consumed
- one more question. Query like this:
Query query = session.createQuery(select u from User u order by
u.age);
query.setFirstResult(10);
query.setMaxResults(30);
= 20 read ops (first 10 skipped) or 30 read ops (GAE read all the 30
entities in background)?

AND which price is valid:
http://code.google.com/appengine/articles/managing-resources.html
(0.7usd   mil/read ops)
or
http://www.google.com/enterprise/cloud/appengine/pricing.html
(0.07usd   10k/ read ops)

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Datastore APIs new pricing - Query (FirstResult/MaxResults)

2011-09-26 Thread Peter Dev
http://code.google.com/appengine/kb/postpreviewpricing.html#two_entities_fetched_operations_consumed

*** Query like this:
Query query = session.createQuery(select u from User u order by
u.age);
query.setFirstResult(10);
query.setMaxResults(30);
= 30 read ops (first 10 skipped) or 40 read ops (GAE read all the 30
entities in background)?

*** Second question which price is valid:
http://code.google.com/appengine/articles/managing-resources.html
(0.7usd   mil/read ops)
or
http://www.google.com/enterprise/cloud/appengine/pricing.html
(0.07usd   10k/read ops)

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[google-appengine] Re: Using memcache might be free, but it's costing you money with instance pricing! Use instance caches if possible.

2011-09-26 Thread Peter Dev
in new pricing model exist something like memcache data transfer
price?

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.