Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to stop baasbox correctly #736

Closed
emresebat opened this issue Apr 13, 2015 · 6 comments
Closed

How to stop baasbox correctly #736

emresebat opened this issue Apr 13, 2015 · 6 comments

Comments

@emresebat
Copy link

Hi

I'm trying to migrate our backend form Parse to BAASBOX. I've prepared a small plugin lib to fetch data, save it etc and testing it. While transferring some data consisting of 50000 orders I had this problem :

  • I've deleted Order collection
  • Started importing 1000 records which is a Parse limitation, and tried this 2-3 times
  • I've seen 3000+ as count in the Collections screen for Order
  • During the migration BAASBOX became unresponsive and I had to login via console and stop the process by killing it
  • The latest count for Order Collection is 500+ now... :(

So my question is, is there a cache level of some kind which could not write disk? Is this because I did not shut down gracefully, since there is no STOP script how should I proceed for stopping an instance?

Thanks.

@giastfader
Copy link
Member

It is strange that BaasBox becomes unresponsive. Could send us the application.log file?
However to stop BaasBox, since it is built on top of the Play Framework, you just have to send a SIGTERM to the process.
Last thing: can you try the 1.0.0-M1 release please? We have improved a lot of things in terms of performance and bottlenecks.

@emresebat
Copy link
Author

Hi

I'm in a hurry so I had to start again with a db restore. It seems the db was corrupt, currently I've imported 50000+ records without problems. But this problem made me wonder what to do in a case like this, is there a tool for fixing the orientdb db files?

Also you think I can use 1.0.0-M1 in production?

@emresebat
Copy link
Author

Ok another instance which may be related to this, now I found a way to crash baasbox. My current amazon ec2 box is 2GB and I'm trying to backup a database, this is the error I see on the shell:

Database export completed in 59929ms 
Uncaught error from thread [application-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[application]
java.lang.OutOfMemoryError: Java heap space
    at org.apache.commons.io.output.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:322)
    at com.baasbox.db.async.ExportJob.run(ExportJob.java:58)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[ERROR] [04/15/2015 15:53:49.445] [application-akka.actor.default-dispatcher-2] [ActorSystem(application)] Uncaught error from thread [application-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.OutOfMemoryError: Java heap space
    at org.apache.commons.io.output.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:322)
    at com.baasbox.db.async.ExportJob.run(ExportJob.java:58)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

2015-04-15 15:53:49,462 - [info] - BaasBox is shutting down... 
2015-04-15 15:53:49,463 - [info] - Closing the DB connections... 
2015-04-15 15:53:49,784 - [info] - Shutting down embedded OrientDB Server 
2015-04-15 15:53:49,785 - [info] - ...ok 
2015-04-15 15:53:49,785 - [info] - Destroying session manager... 
2015-04-15 15:53:49,785 - [info] - Session Cleaner: cancelled 
2015-04-15 15:53:49,785 - [info] - ...BaasBox has stopped 
2015-04-15 15:53:49,785 - [info] - Shutdown application default Akka system. 

And current memory

            total       used       free     shared    buffers     cached
Mem:       2052388     601764    1450624          0      24052     380084
-/+ buffers/cache:     197628    1854760
Swap:            0          0          0

And when I check the baasbox dashboard I see this
screenshot 2015-04-15 19 09 50

So my backup fails, is it just because baasbox cannot allocate more memory for dumping? How can I raise the Max Allocable Memory?

@avently
Copy link

avently commented Apr 15, 2015

Hey @emresebat!
I see you are using Baasbox on Amazon EC2. I also want to install Baasbox on EC2. Can you please tell me about Baasbox performance on 1-2 gb Amazon instance? How many queries it can handle per sec and other info about it.

@emresebat
Copy link
Author

Hi @avently

I'm using it without problems but I don't have a real performance data yet. I can give a hint with my problem, I'm trying to find a record in a 50000 collection with an string id and it takes around 1.5 - 2.0 secs. This is without any indexex so I need to create one but baasbox does not provide this I think.

According to this, it's available with 1.0.0 M1 version #608

@avently
Copy link

avently commented Apr 16, 2015

Yep, OrientDB not so fust as I thought. Postgres found a record in collection of 30000 records ~ 30 milliseconds. OrientDB - ~ 1 second!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants