cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

stress:each node's data size is in big difference

Open a6802739 opened this issue 10 years ago • 8 comments

my table schema is like this:

[email protected]:26660> show columns from bank;
+-------------+---------------+-------+---------+
|    Field    |     Type      | Null  | Default |
+-------------+---------------+-------+---------+
| id          | INT           | false | NULL    |
| name        | STRING(32)    | true  | NULL    |
| weight      | FLOAT         | true  | NULL    |
| height      | DECIMAL(20,8) | true  | NULL    |
| deleted     | BOOL          | true  | NULL    |
| create_time | TIMESTAMP     | true  | NULL    |
| delete_time | TIMESTAMP     | true  | NULL    |
| description | STRING(300)   | true  | NULL    |
| content     | STRING(300)   | true  | NULL    |
+-------------+---------------+-------+---------+

[email protected]:26660> show index from bank;
+-------+----------------------+--------+-----+-------------+-----------+---------+
| Table |         Name         | Unique | Seq |   Column    | Direction | Storing |
+-------+----------------------+--------+-----+-------------+-----------+---------+
| bank  | primary              | true   |   1 | id          | ASC       | false   |
| bank  | idx_name_create_time | false  |   1 | name        | ASC       | false   |
| bank  | idx_name_create_time | false  |   2 | create_time | ASC       | false   |
+-------+----------------------+--------+-----+-------------+-----------+---------+

I start 3000 process(client, python) to load data to my cluster. one insert statement in my test has only one row.

my cluster has 20 nodes in 4 server, each server has 5 nodes.(each node occupy one SSD)

after 3 hours' load, the cluster's status is like this:

075a25dc86c1693616fc72dcf046c0e1

the data size of some nodes is in big difference.

then I check the log in node szwg-dba-sz-cr03.szwg01:26663, it's just like this:

E160713 17:48:45.508182 storage/queue.go:467  [split] on range=22 [/Table/51-/Max): storage/replica_command.go:2179: split at key /Table/51/1/636673 failed: context deadline exceeded
E160713 17:48:47.946545 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:48:54.728863 storage/queue.go:467  [split] on range=22 [/Table/51-/Max): storage/replica_command.go:2179: split at key /Table/51/1/628208 failed: context deadline exceeded
E160713 17:48:57.989329 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:49:15.036050 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:49:18.566200 storage/queue.go:467  [split] on range=22 [/Table/51-/Max): storage/replica_command.go:2179: split at key /Table/51/1/626927 failed: context deadline exceeded
E160713 17:49:23.700785 storage/queue.go:467  [split] on range=22 [/Table/51-/Max): storage/replica_command.go:2179: split at key /Table/51/1/624540 failed: context deadline exceeded
E160713 17:49:26.752432 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:49:40.619778 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:49:48.980965 storage/queue.go:467  [split] on range=22 [/Table/51-/Max): storage/replica_command.go:2179: split at key /Table/51/1/623931 failed: context deadline exceeded
E160713 17:49:54.974529 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:50:03.151136 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:50:10.679928 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:50:13.733842 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:50:32.420506 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:50:48.776182 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:50:51.827937 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:51:00.048088 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:51:08.161711 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:51:09.070282 storage/queue.go:467  [split] on range=22 [/Table/51-/Max): storage/replica_command.go:2179: split at key /Table/51/1/621996 failed: context deadline exceeded
E160713 17:51:11.212139 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:51:20.553560 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:51:23.604748 storage/queue.go:467  [raftlog] on range=22 [/Table/51-/Max): context deadline exceeded
E160713 17:51:32.984964 storage/queue.go:467  [split] on range=22 [/Table/51-/Max): storage/replica_command.go:2179: split at key /Table/51/1/618185 failed: context deadline exceeded

a6802739 avatar Jul 13 '16 09:07 a6802739

The problem of very large .sst files (in Gitter you said you had one sst file that was 2.4GB) should be fixed by #7562 which will be included in this week's beta.

Also, you shouldn't need to run multiple nodes per server just because you have multiple SSDs. You can run one server with five stores. If running five servers per machine is working better for you than one server with five stores, please let us know what you're seeing since it sounds like a problem that should be fixed.

bdarnell avatar Jul 13 '16 15:07 bdarnell

@bdarnell , I have tried with one node with 5 stores(btw, client is same), the qps of the whole cluster is about 1000qps, and the same problem also occur in this case, and the cluster's status is not stable. The qps in the case one node with one store, the qps is about 3000 qps, and the status of the cluster is quite stable.

I have few questions.

  1. how you guys stress the cluster, in my stress test, my whole cluster's hardware is hard to reach bottleneck, sometimes I increase the client's concurrent number, the cpu's status may reach the bottleneck(however the qps is not increased always), but the SSD's usage is about 20%. my network bandwidth is about 1000MB/s, so the network never reach bottleneck. could you show me you guys' stress method, so I could try it in my cluster.
  2. what does context deadline exceeded means in the log.

a6802739 avatar Jul 14 '16 06:07 a6802739

You may see higher performance with one store per node because in that case CockroachDB doesn't know not to place all your replicas on different disks of the same machine. When you run one node with five stores, we know that we must place replicas on different machines, which will slow things down (but ensure that you don't lose data when one machine dies with all of its stores).

We currently stress-test the cluster primarily with the block_writer and photos apps from https://github.com/cockroachdb/examples-go. However, we are also not yet able to achieve 100% utilization of the hardware; we are still working on turning and performance.

context deadline exceeded means that some operation was not able to complete in the allotted time. More context is needed to tell what exactly is going on. It's normal to see a few of these messages from time to time, but they shouldn't be happening often.

bdarnell avatar Jul 14 '16 16:07 bdarnell

@bdarnell , I agree with you.

however, when I start one node per machine, my whole cluster only have four nodes.

after I run client(3000 python process), the node is not stable. sometimes it will kill himself, when I restart the node, after a while, it will coredump.

goroutine 221 [syscall, locked to thread]:
runtime.cgocall(0x11da170, 0xca875ea078, 0x7fd100000000)
        /usr/local/go/src/runtime/cgocall.go:123 +0x11b fp=0xca875ea020 sp=0xca875e9ff0
github.com/cockroachdb/cockroach/storage/engine._Cfunc_DBApplyBatchRepr(0x7fd17b9fe610, 0xcc78bb0000, 0xb65f57db, 0x0, 0x0)
        ??:0 +0x53 fp=0xca875ea078 sp=0xca875ea020
github.com/cockroachdb/cockroach/storage/engine.dbApplyBatchRepr(0x7fd17b9fe610, 0xcc78bb0000, 0xb65f57db, 0x100000000, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/storage/engine/rocksdb.go:1117 +0x138 fp=0xca875ea110 sp=0xca875ea078
github.com/cockroachdb/cockroach/storage/engine.(*rocksDBBatch).ApplyBatchRepr(0xc8202cba40, 0xcc78bb0000, 0xb65f57db, 0x100000000, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/storage/engine/rocksdb.go:670 +0xb3 fp=0xca875ea158 sp=0xca875ea110
github.com/cockroachdb/cockroach/storage/engine.(*rocksDBBatch).flushMutations(0xc8202cba40)
        /go/src/github.com/cockroachdb/cockroach/storage/engine/rocksdb.go:789 +0x14f fp=0xca875ea1e8 sp=0xca875ea158
github.com/cockroachdb/cockroach/storage/engine.(*rocksDBBatchIterator).Seek(0xc8202cba70, 0xc91d632000, 0x12, 0x20, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/storage/engine/rocksdb.go:577 +0x25 fp=0xca875ea220 sp=0xca875ea1e8
github.com/cockroachdb/cockroach/storage/engine.mvccGetMetadata(0x7fd24771f640, 0xc8202cba70, 0xc91d632000, 0x12, 0x20, 0x0, 0x0, 0xc94133a000, 0x5e82d7, 0x60861d, ...)
        /go/src/github.com/cockroachdb/cockroach/storage/engine/mvcc.go:617 +0xcf fp=0xca875ea358 sp=0xca875ea220
github.com/cockroachdb/cockroach/storage/engine.mvccPutInternal(0x7fd24765d8a0, 0xc820076998, 0x7fd2476f6310, 0xc8202cba40, 0x7fd24771f640, 0xc8202cba70, 0x0, 0xc91d632000, 0x12, 0x20, ...)
        /go/src/github.com/cockroachdb/cockroach/storage/engine/mvcc.go:953 +0x1f9 fp=0xca875ea8a0 sp=0xca875ea358
github.com/cockroachdb/cockroach/storage/engine.mvccPutUsingIter(0x7fd24765d8a0, 0xc820076998, 0x7fd2476f6310, 0xc8202cba40, 0x7fd24771f640, 0xc8202cba70, 0x0, 0xc91d632000, 0x12, 0x20, ...)
        /go/src/github.com/cockroachdb/cockroach/storage/engine/mvcc.go:921 +0x1bb fp=0xca875ea978 sp=0xca875ea8a0
github.com/cockroachdb/cockroach/storage/engine.MVCCPut(0x7fd24765d8a0, 0xc820076998, 0x7fd2476f6278, 0xc8202cba40, 0x0, 0xc91d632000, 0x12, 0x20, 0x0, 0x0, ...)
        /go/src/github.com/cockroachdb/cockroach/storage/engine/mvcc.go:859 +0x1bb fp=0xca875eaa48 sp=0xca875ea978
github.com/cockroachdb/cockroach/storage/engine.MVCCPutProto(0x7fd24765d8a0, 0xc820076998, 0x7fd2476f6278, 0xc8202cba40, 0x0, 0xc91d632000, 0x12, 0x20, 0x0, 0x0, ...)
        /go/src/github.com/cockroachdb/cockroach/storage/engine/mvcc.go:479 +0x1c5 fp=0xca875eab18 sp=0xca875eaa48
github.com/cockroachdb/cockroach/storage.(*Replica).append(0xc8203223c0, 0x7fd2476f6278, 0xc8202cba40, 0x0, 0xc8209905a0, 0x1, 0x1, 0x128, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/storage/replica_raftstorage.go:464 +0x20f fp=0xca875eac58 sp=0xca875eab18
github.com/cockroachdb/cockroach/storage.(*Replica).applySnapshot(0xc8203223c0, 0xc998880000, 0xc3623b32, 0xc3624000, 0xc8443a6520, 0x3, 0x4, 0x0, 0x0, 0x0, ...)
        /go/src/github.com/cockroachdb/cockroach/storage/replica_raftstorage.go:580 +0xb40 fp=0xca875eb1e8 sp=0xca875eac58
github.com/cockroachdb/cockroach/storage.(*Replica).handleRaftReady(0xc8203223c0, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/storage/replica.go:1393 +0x25f fp=0xca875ebbd0 sp=0xca875eb1e8
github.com/cockroachdb/cockroach/storage.(*Store).processRaft.func1()
        /go/src/github.com/cockroachdb/cockroach/storage/store.go:2163 +0x35d fp=0xca875ebf60 sp=0xca875ebbd0
github.com/cockroachdb/cockroach/util/stop.(*Stopper).RunWorker.func1(0xc8203923f0, 0xc8208025e0)
        /go/src/github.com/cockroachdb/cockroach/util/stop/stopper.go:142 +0x52 fp=0xca875ebf80 sp=0xca875ebf60
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1998 +0x1 fp=0xca875ebf88 sp=0xca875ebf80
created by github.com/cockroachdb/cockroach/util/stop.(*Stopper).RunWorker
        /go/src/github.com/cockroachdb/cockroach/util/stop/stopper.go:143 +0x62

and, the range split problem also occur in the two situation.

after I stop the load, the split will success and range will rebalanced out.

a6802739 avatar Jul 15 '16 03:07 a6802739

however, when I start one node per machine, my whole cluster only have four nodes.

Why is that a problem? If you have four machines, then you should have four nodes.

3000 client processes is more than we've tested with; it's not surprising if you run out of memory or have other problems with that much load. We're working on handling this kind of overload more gracefully (#7657). In the meantime if you need lots of client processes, you might be able to reduce their load on the database by using a load balancer like pgbouncer.

bdarnell avatar Jul 15 '16 16:07 bdarnell

@bdarnell , ok, I know it. thanks a lot. I will try to reduce the load right now.

I just want to test my cluster's scalability and the performance inflection point of my whole cluster through with the increasing load of my client.

a6802739 avatar Jul 18 '16 10:07 a6802739

@a6802739 anything new to report here?

tamird avatar Sep 09 '16 14:09 tamird

Closing for lack of activity. The original problem has been addressed.

spencerkimball avatar Apr 02 '17 00:04 spencerkimball