-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Delete of embedded Cassandra? #380
Comments
I have extensive experience with Cassandra, so I can carry this forward if you guys aren't looking forward to maintaining this... |
AFAIK: The head is 0.4.0. 0.3.3 will go into the titan-03 branch. For 0.4.0, cassandra-embedded is no longer available. On Sep 24, 2013, at 10:16 AM, Matt Pouttu-Clarke notifications@github.com wrote:
|
As discussed on the mailing list (https://groups.google.com/d/topic/aureliusgraphs/EasJTTkDtfY/discussion) we are removing the embedded option for Cassandra since it is slower than running Cassandra in a separate process and communicating over localhost. We will provide helper scripts to make that setup easy to use. You could maintain the adapter in a separate repo. We are removing it because we see little benefit and a lot of additional code complexity. |
Thanks for the feedback. It looks like you guys are testing with Amazon using ephemeral disk. Are you interested in results with Cassandra on Fusion-io? I think you will find different results when the storage is faster than the network interface... I have some bare metal Fusion-io machines available, if you want I can run some tests. |
FYI: I have already tried the Amazon Flash instances with both RHEL 6 and Amazon Linux and they're extremely slow compared to bare metal. |
Making sure I understand you correctly: Are you saying that using Cassandra That's why we are moving away from Cassandra embedded since I believe that On Tue, Sep 24, 2013 at 12:49 PM, Matt Pouttu-Clarke <
Matthias Broecheler |
I was wondering if you had tested with Flash (esp. PCI Flash like Fusion-io). The heap pressure is mitigated by:
In my use case I am even considering directly integrating with the Flash API via JNI because Cassandra may be too slow even with all of the above. So for my use case my latency requirement is such that I am considering either in-process Cassandra or direct interface to Flash. I have tested Cassandra directly on localhost interface and it is not fast enough, although this test was not with Titan in the middle I have to assume that injecting Titan will introduce more latency than I am willing to accept... |
That's really interesting. Do you have any numbers that you could share. I agree that there is a lot of tuning you can do to reduce the latency of Thanks for the great discussion Matt. On Wed, Sep 25, 2013 at 8:42 AM, Matt Pouttu-Clarke <
Matthias Broecheler |
I haven't had a lot of luck so far with a non-embedded Cassandra with low latency and I've been working at it for 1+ years. We still haven't been able to pull the switch on using Cassandra in our low latency products. I was hoping the embedded Cassandra would work out better, or some of the newer Flash capabilities DataStax is working on. Yes, data grids work well for this as long as the GC doesn't get out of hand. I have some interesting design patterns I use to avoid the GC and enable off-heap storage that spills over to Flash. Unfortunately, no Java APIs or tools I'm aware of actually are able to use these design patterns out of the box. I've had to re-write Guava BloomFilter and CERN BitVector for example to utilize my methods. For the data sizes I'm dealing with the price difference between RAM and Flash makes these efforts worthwhile. But yes, you guys have it right that the GC is the enemy of low latency, however I'm not sure separating Titan and Cassandra into different JVMs would solve the root cause of the problem. |
Sure I can share some stats, I will start running Titan/Cassandra embedded and non-embedded tests today with both an 8 disk RAID0 and fio. I’ll let you know how it goes. Here’s the box spec: HP DL380p Gen 8 Fusion IO IODrive 640G RHEL 6.4, JDK 1.7.0_25 From: Matthias Broecheler [mailto:notifications@github.com] That's really interesting. Do you have any numbers that you could share. I agree that there is a lot of tuning you can do to reduce the latency of Thanks for the great discussion Matt. On Wed, Sep 25, 2013 at 8:42 AM, Matt Pouttu-Clarke <
Matthias Broecheler — |
Here's my load test class, any comments? I am getting a lot of the "ID could not be recognized" errors on vertex read: import java.io.File; import org.apache.commons.configuration.BaseConfiguration; import com.thinkaurelius.titan.core.TitanFactory; public class GraphLoad {
} |
You are doing this: |
How would I get the id that Titan assigned? I tried v.getId and it didn’t seem to work From: Matthias Broecheler [mailto:notifications@github.com] You are doing this: — |
@mbroecheler well, I never expected to be a line of code, but thank you. |
@vertex haha, sweet username you got there. |
@mpouttuclarke Titan assigns the ids after the transaction commits, at which point you can do v.getId() to get the id as an object (Tinkerpop compliant) or v.getID() to get the long id (Titan specific). |
@mbroecheler There's a lot of objects hanging around in memory. Do you know a way to clear them out? I am committing every 10000 records. $ /usr/share/jdk1.7.0_40/bin/jmap -histo:live 43165 | head num #instances #bytes class name1: 38454497 2153451832 com.thinkaurelius.titan.graphdb.relations.StandardProperty |
Actually from the heap dump the solution is quite simple, you have to clear the SimpleIndexCache and SimpleVertexCache on commit or rollback of transaction. These are the lines of code that need to be fixed com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx:
867
868
869
|
Either that or you can make them LRU, but for my data sizes that would not matter much. |
I can do fork and pull and verify the fix, if you want... I need the fix right away to continue load testing |
@mpouttuclarke You are right, the transaction keeps pointers to all vertices in the transaction. We have an outstanding ticket #335 which is about using caches instead of normal maps so that memory can be released. However, i don't understand why the transactional state keeps piling up. If you commit the transaction and release the pointer to it, then the garbage collector should clean things up. Or are you holding on to the vertex objects somewhere? |
The code is above, so no, I'm not holding a reference. Unless tx = graph.newTransaction(); returns the same instance to the same thread. |
Also, the thing is that the garbage collector may not be able to trace the vertex and property instances back to the holding object quickly enough. In that case explicitly freeing the objects helps the garbage collector free the nested objects sooner. |
Ah, I was looking at the writing threads. Those commit regularly and you start a new transaction which should effectively release the memory. However, the reading threads don't and so you load more and more of the graph into each of the transactions which fills up your heap. |
@mbroecheler It even happens when I only spawn writer threads. Here is the result of the heap dump analysis for only writer threads: So overall, this is resulting in 95% of heap allocation: |
@mbroecheler: so I will simply add code in close() to clear the caches in my fork, that should fix my immediate problem. |
@mpouttuclarke Let me know if that helps. I still cannot make logical sense of that. When you do tx = graph.newTransaction(); the only pointer to the previous transaction is released. There does not seem to be any other reference to that transaction (or any element in it) inside the run() method. Hence, GC should be able to determine that it can release the transaction and all its associated memory. I agree that there might be some inefficiencies on the side of the GC, but when the heap pressure becomes high enough, a mark-and-sweep should clear this out. |
@mpouttuclarke Couldn't let go and went ahead to implement an LRUVertexCache. Check out commit: Added a test case that shows that memory is not leaking anymore: |
Wow, thanks! From: Matthias Broecheler [mailto:notifications@github.com] @mpouttuclarkehttps://github.com/mpouttuclarke Couldn't let go and went ahead to implement an LRUVertexCache. Check out commit: Added a test case that shows that memory is not leaking anymore: — |
By doing a small change in CassandraEmbeddedKeyColumnValueStore.java#L341, you should have a performance improvement, unless read slices are very small. Why ? When reading from Cassandra, this implementation is used because:
In this case, because Cassandra is embedded, there is no serialization involved and the structure is used directly. |
Created a new ticket #417 |
On the head it looks like this functionality was deleted. This is a non-backward compatible change and I am currently using this, so is there an alternative being introduced?
The text was updated successfully, but these errors were encountered: