SmartApp Latency issues?

Wondering if anyone has any info on what exactly the SmartApp issues have been this week?

I have a web app that I use to manage multiple hubs from one interface using a custom web services SmartApp. Previously we were able to send out X separate post requests to X number of hubs and all SmartApps would execute separately. That’s to be expected since each hub has their own smart app and separate account.

The issue we are experiencing now is that if we send off more than one request only one SmartApp will execute correctly. All the others will stop when it’s time for the hub to send commands to the lock.

In our case, all the hubs receive their instructions and all hubs get the right JSON object. They are then instructed to set and or delete user codes from their lock. Unfortunately right now only one out of the X number of hubs we send the requests to will actually go through. The others seem to just stop in their tracks and never execute (live logs). It’s as if the server gets locked up and can’t execute more than one at a time.

If I do one manually and wait about 30 seconds for each hub the requests go through without a problem.

Any ideas on if this is related to the smart app issues currently?

There are some very serious performance issues right now, so I’d say this is highly likely the cause of any sudden change in behavior.

What you described seems perfectly reasonable; however, multiple SmartApps instances do share the same JVMs (to the best of my knowledge) … and for good reason … and I think there is some effort underway to make this even more prevalent in order to optimize resource utilization.

Perhaps it is having unintended side effects like the wait/blocking you notice.

Trying to think of who to tag… @vlad?

Reference:

1 Like

The JVM link is awesome. Thanks for referencing that. Sounds a lot like what may be happening. It’s locking up. Whats crazy is it won’t even do two at a time. There has to be something wrong… I can’t imagine not being able to run two smartapps on different hubs at the same time. How do community apps function at the large scale that SmartThings is at right now?

Unless I’m misunderstanding this, how do multiple Alexa SmartApps function? I would think there’s more than a few running at any given time.

There’s probably thousands running at the same time.

Whatever you are experiencing has got to be a platform overload or a bug, unless you’ve got some really, really weird code or corruption.

1 Like

@tgauchat Agreed, It has to be able to support numerous instances of a smartapp. The platform I would think wouldn’t have a problem handling a couple hundred different instances of a SmartApp running at the same time for no more than the 20 second rate limit per method of course.

Literally all I’m doing is sending a JSON string, setting lock codes with a minor time out so as not to bombard the lock and that’s all. It’s even using the provided z-wave lock device handler from SmartThings.

There has to be something not right. It would be really weird for a simple SmartApp to only be able to run once and lock up the other instances.

@slagle @jody.albritton any insight on what might be wrong? SmartApp issues, buggy code on my end, platform can’t support what I’m doing?

If you want to PM me the email your account is under, I would be happy to take a glance at our logs and see if you are running into any exceptions :slight_smile:

3 Likes

This is all very interesting. Is there an explanation of the ST cloud infrastructure somewhere? I assume it sits on Google or else AWS?

As to how Alexa handles things, well that all runs in Amazon Web Services, which is a remarkable infrastructure. There is even the ability for developers to write Alexa code (in Java, PHP or Python) and upload it to AWS.

I think SmartThings is on AWS.

The Alexa integration is a published web services Smart App…if I’m not mistaken. So technically it should function in the same manner as other community apps. Of course, given their customer base I’m sure they get some preferential treatment as they should.

Sent. Thanks!

Actually, there are a lot of “technical” differences for a published SmartApp vs a cut/paste/GitHub shared Community App.

And Amazon Echo SmartApp is definitely using at least one (if not more…) APIs that are not available to Community Developers (published or not).

Right I’m sure there’s a lot of differences but at a basic level they probably all run in a JVM…who knows for sure but it’s logical to think that their smartapps instances run similar caching and GC. Probably on their own isolated from the community…that’s just my guess though…I have no idea.

1 Like

I’ve had to pause my migration to CoRE. It is too painful while all of these issues are going on.