Greetings,

I have 2 issues, the first of which I had before WOWODC, and the second burst 
into the open yesterday.

I have an app, an ERRest app, acting as a push notification server, although 
thus far now push notifications have gone out to the public, it works for 
testing.  The app is connected to by nearly 50,000 iOS devices which have our 
iOS app installed.  The iOS app connects to Apple to get a token, then calls 
home (my server) and tries to register itself with my server so that when we do 
send out notifications, we know which device tokens want which types of 
notifications.  The iOS apps on individual iOS devices connect when running, 
and send information to my server about the device, the id of the device, other 
data including the token and whether they want the 4 notification types to be 
on or off.  All this works.  (there are approximately 50,000 registered 
application_device rows currently, though we've not sent any publicly visible 
notifications).  When the app runs, the devices also try and get the last 
notification of any type that the device has been set to ask for, and display 
that in a drop down (data pulled from my server)

The server uses ERRest to receive this information and to create a device 
(actually an "ApplicationDevice" object) based on passed in json, checks the 
database (MySQL) to see if there is an existing row in my application_device 
entity/table for the app, and the device id (udid) and if so, updates it with 
the newly created device's data before discarding the new device and saving the 
changes in the fetched one.  Otherwise, it saves the newly created device.

However,

1. Occasionally, two devices try to be created at the same time with the same 
primary key (which is provided by the EO_PK_Table in the MySQL database).  The 
second device fails with an exception.  I gather this is because two separate 
devices are connecting to the server at approximately the same time, both 
asking the EO_PK_Table for the next primary key for the entity, then do some 
things, then try and save.  First one succeeds, and the second fails because an 
object with the PK already exists.  I was under the impression that EOF should 
handle this, but it doesn't seem to.

2. We tried to send out some test notifications yesterday, which exposed some 
inefficiencies in my model, which seem to have been resolved, but there are 
still significant issues.  Apache and MySQL are fine, neither is pressed, but 
the CPU approaches 100% usage in spikes on the server (a CentOS VM with 16 GB 
RAM running Java 1.6 64 bit).  Nothing else is running on it.  The individual 
queries in the registration process do not return more than 5 rows, though 
there are 18 separate SQL calls caused by the registration method, all but one 
returns 1 row, and the other returns 5.  In any event, MySQL has no slow 
queries.

So it's the WO Java processes that seem to be taking up 100% of the CPU.  
Constantly getting worker-thread broken pipe errors when it is pressed like 
that.

Does anyone have any insight on either of these?

ERRest, post-WOWODC Wonder

Andrew Kinnie _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to