Situation:
Network bandwidth to the Perforce server is limited (I'm working remotely).
The repository I wanted to branch contains lots of binary files and it's many gigabytes in size.
The count of files is large (about 500000 files).
When I issue a p4 populate command to populate a new dev branch, the operation takes 1-2 hours to finish, why?
As far as I know populate does the branching in place and doesn't pull the entire repo through the network, so I don't think it's a network issue.
Creating a million entries in a database shouldn't take long as well.
Does it copy the binary files into the new repository, instead of just referencing them?
EDIT here is the log after I branched again using -Ztrace:
57055 files branched (change 2779417).
--- lapse 6408s
--- usage 3573+2619us 0+0io 0+0net 65672k 0pf
--- rpc msgs/size in+out 2+57059/0mb+13mb himarks 785732/280100 snd/rcv 3.38s/.047s
--- db.counters
--- pages in+out+cached 11+16+2
--- locks read/write 0/4 rows get+pos+scan put+del 3+0+0 4+0
--- db.logger
--- pages in+out+cached 6+4+4
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 2+0
--- db.user
--- pages in+out+cached 4+0+3
--- locks read/write 1/0 rows get+pos+scan put+del 1+0+0 0+0
--- db.group
--- pages in+out+cached 5+0+4
--- locks read/write 1/0 rows get+pos+scan put+del 0+3+5 0+0
--- db.domain
--- pages in+out+cached 7+0+5
--- locks read/write 2/0 rows get+pos+scan put+del 2+0+0 0+0
--- db.view
--- pages in+out+cached 7+0+7
--- locks read/write 4/0 rows get+pos+scan put+del 0+4+57 0+0
--- db.integed
--- pages in+out+cached 42486+51286+192
--- pages reordered internal+leaf 180+5972
--- pages split internal+leaf 182+4377
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 114110+0
--- total lock wait+held read/write 0ms+0ms/0ms+5175ms
--- db.archmap
--- pages in+out+cached 28+47+26
--- pages split internal+leaf 1+12
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 502+0
--- total lock wait+held read/write 0ms+0ms/0ms+1174ms
--- db.revdx
--- pages in+out+cached 3+0+1
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 0+0
--- total lock wait+held read/write 0ms+0ms/0ms+1174ms
--- db.revhx
--- pages in+out+cached 2888+8526+96
--- pages split internal+leaf 85+2783
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 57055+0
--- total lock wait+held read/write 0ms+0ms/0ms+1174ms
--- db.revpx
--- pages in+out+cached 233571+357872+96
--- pages split internal+leaf 79+2395
--- locks read/write 0/114110 rows get+pos+scan put+del 0+0+0 57055+57055
--- total lock wait+held read/write 0ms+0ms/5846ms+2128ms
--- max lock wait+held read/write 0ms+0ms/99ms+9ms
--- db.revcx
--- pages in+out+cached 1414+4160+96
--- pages split internal+leaf 43+1356
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 57055+0
--- total lock wait+held read/write 0ms+0ms/0ms+1174ms
--- db.rev
--- pages in+out+cached 10977+7868+96
--- pages split internal+leaf 76+2570
--- locks read/write 2/1 rows get+pos+scan put+del 57055+7+184634 57055+0
--- total lock wait+held read/write 0ms+571ms/0ms+1174ms
--- max lock wait+held read/write 0ms+571ms/0ms+1174ms
--- peek count 1 wait+held total/max 0ms+0ms/0ms+0ms
--- db.trigger
--- pages in+out+cached 4+0+2
--- locks read/write 2/0 rows get+pos+scan put+del 0+2+35 0+0
--- db.change
--- pages in+out+cached 13+12+4
--- locks read/write 0/3 rows get+pos+scan put+del 3+0+0 2+1
--- total lock wait+held read/write 0ms+0ms/0ms+1175ms
--- max lock wait+held read/write 0ms+0ms/0ms+1175ms
--- db.changex
--- pages in+out+cached 11+8+3
--- locks read/write 0/3 rows get+pos+scan put+del 0+0+0 1+1
--- total lock wait+held read/write 0ms+0ms/0ms+1175ms
--- max lock wait+held read/write 0ms+0ms/0ms+1175ms
--- db.changeidx
--- pages in+out+cached 5+0+1
--- locks read/write 0/2 rows get+pos+scan put+del 0+0+0 0+0
--- total lock wait+held read/write 0ms+0ms/1ms+1174ms
--- max lock wait+held read/write 0ms+0ms/1ms+1174ms
--- db.desc
--- pages in+out+cached 13+12+4
--- locks read/write 0/3 rows get+pos+scan put+del 0+0+0 2+1
--- total lock wait+held read/write 0ms+0ms/0ms+1174ms
--- max lock wait+held read/write 0ms+0ms/0ms+1174ms
--- db.protect
--- pages in+out+cached 9+0+8
--- locks read/write 1/0 rows get+pos+scan put+del 0+1+410 0+0
--- db.monitor
--- pages in+out+cached 2+6+256
--- locks read/write 4/2 rows get+pos+scan put+del 4+0+0 1+1
If you run a command with the global flag -Ztrack, e.g.:
p4 -Ztrack populate (args...)
you'll get a bunch of performance debugging information that includes where the server was spending its time. (This information is probably already stored in the server log, if you don't want to have to run the command again; you just need to track it down in there.)
In the general case, p4 populate is a metadata-only command (copying rows in the revision tables and adding integed rows to connect them), and all of the actual file contents are simply "lazy copied" by virtue of having additional references to the same underlying archive.
The exception to this is if there are revisions that can't be lazy-copied. Off the top of my head the two cases of that I can think of are remote depots and +S files (maybe some of those large binaries you mentioned).
In any event, if you can get the performance tracking information, you can see whether the server was spending all of its time on creating database entries (in which case I'd look at the disk that the database is on and see if there's any way to speed it up -- is it network-mounted, is it shared by a bunch of other processes, etc) or if it was copying archives around (in which case you'll want to figure out why it needs to do that and if there's any way to avoid it -- for example, I always recommend against using the +S filetype flag for files that are going to be branched).
Related
Is there a way to set a limit on total (not simultaneous) used resources (core hours/minutes) for specific User or Account in SLURM?
My total spent resources in seconds are for example 109 seconds usage of threads. I want to limit that just for my user not minding the sizes of submitted jobs until that limit is reached.
[root#cluster slurm]# sreport job SizesByAccount User=HPCUser -t Seconds start=2022-01-01 end=2022-07-01 Grouping=99999999 Partition=cpu
--------------------------------------------------------------------------------
Job Sizes 2022-01-01T00:00:00 - 2022-06-16T14:59:59 (14392800 secs)
Time reported in Seconds
--------------------------------------------------------------------------------
Cluster Account 0-99999998 CP >= 99999999 C % of cluster
--------- --------- ------------- ------------- ------------
cluster root 109 0 100.00%
I am looking to get all the submitted change-lists for a particular day and the command I have used is below:
$ p4 changes -s submitted //...#2020/11/03,2020/11/04
So, I believe that the above command should get me the list of all submitted change-lists from 3rd Nov 2020 to 4th Nov 2020.
Instead, I see this:
Too many rows scanned (over 55000000); see 'p4 help maxscanrows'.
What should I do to get rid of it?
The "maxscanrows" setting (which is configured by the admin for each user group) constrains the number of database rows that are scanned by any given query. In the case of p4 changes, there are two different ways the query might run, depending on the arguments you pass:
If a path is specified, the db.rev entries matching the path are scanned, and the changelists matching the revision range are selected from that set. db.rev is indexed by path.
If no path is specified, and if the revision range does not depend on revision data (e.g. dates, which are contained in the changelists themselves), db.change entries are scanned in order to locate the ones matching the range.
An exception to (1) is that if a maximum number of changelists is requested, db.revcx may be used if the path is very broad. This logic can be tuned and is described in p4 help undoc:
dm.changes.thresh1 50K 'changes -mx path' uses db.revcx if...
dm.changes.thresh2 10K ...if < thresh2 of thresh1 db.rev match
For your specific case, I think you will find that:
p4 changes -s submitted #2020/11/03,2020/11/04
performs much faster (and without hitting the maxscanrows limit), because it will search based on db.change.
As you noted in your own answer, narrowing the depot path is another possible solution, because that will reduce the number of db.rev rows scanned -- however, this will give you different results (and depending on how much you narrow the depot path, it still may not be as quick as simply scanning the change table).
In order to see which specific tables are accessed by a given query, and how many rows of each are accessed, you can use the -Zdbstat global flag:
C:\Perforce\test>p4 -Zdbstat changes -s submitted #2019/11/03,2020/11/04
...
--- db.revcx
--- pages in+out+cached 1+0+1
--- locks read/write 0/0 rows get+pos+scan put+del 0+0+0 0+0
--- peek count 1 wait+held total/max 0ms+0ms/0ms+0ms
...
--- db.change
--- pages in+out+cached 5+0+4
--- locks read/write 0/0 rows get+pos+scan put+del 0+1+127 0+0
--- peek count 1 wait+held total/max 0ms+0ms/0ms+0ms
...
vs:
C:\Perforce\test>p4 -Zdbstat changes -s submitted //...#2019/11/03,2020/11/04
...
--- db.rev
--- pages in+out+cached 27+0+26
--- locks read/write 0/0 rows get+pos+scan put+del 0+1+868 0+0
--- peek count 1 wait+held total/max 0ms+16ms/0ms+16ms
...
--- db.change
--- pages in+out+cached 4+0+3
--- locks read/write 0/0 rows get+pos+scan put+del 0+64+128 0+0
--- peek count 1 wait+held total/max 0ms+0ms/0ms+0ms
...
This can be a very helpful tool in tuning queries for efficiency in cases like this where you have multiple ways to get at a particular piece of data, and especially in understanding why you're bumping into specific performance limits.
Probably, we should use this:
p4 changes //path/to/depot/...#2020/11/03,2020/11/05
Nodes will frequently be marked down with the following message:
ERROR [MessagingService-Incoming-/192.168.1.34] 2019-09-12 10:52:54,054 MessagingService.java:823 - java.util.concurrent.RejectedExecutionException while receiving WRITES.WRITE from /192.168.1.34, caused by: Too many pending remote requests!
I have tried narrowing the problem down and I think its memtable related.
Because when I run a nodetool tpstats it shows TPC/all/WRITE_MEMTABLE_FULL having approx 4000 active.
Looking through opscenter graphs I can see
that TP: Write Memtable Full Active is at approx 4000 and TP: Gossip Tasks Pending keeps increasing and OS: CPU User sits at 80%.
I have also noticed commit log directory exceeds what we set of 16GB and have seen a node with 7911 files(248GB)
The nodes were previously set to have
cassandra-env.sh
MAX_HEAP_SIZE="64G"
HEAP_NEWSIZE="16G"
cassandra.yaml
commitlog_segment_size_in_mb: 32
memtable_heap_space_in_mb: 4096
memtable_offheap_space_in_mb: 4096
memtable_cleanup_threshold: 0.5
commitlog_total_space_in_mb: 16384
memtable_flush_writers: 2
I am currently trying to use these new settings on one of the nodes to see if it fixes the servers performance
memtable_heap_space_in_mb: 10240
memtable_offheap_space_in_mb: 2048
memtable_cleanup_threshold: 0.11
memtable_flush_writers: 8
If anyone has any ideas on what else I can look at.
Also how do I view MemtablePool.BlockedOnAllocation metric that it details against the memtable_flush_writers section in http://cassandra.apache.org/doc/latest/configuration/cassandra_config_file.html
I have deployed cassandra cluster in kubernetes environment as pods.
I have 2 cassandra pods/nodes and each with have 12 GB RAM, 1 VCPU and using distributed storage for data.
When I tried to load data using COPY command it saying "child process(es) died unexpectedly, aborting ".
cqlsh> COPY aarun.emp FROM '/home/etolaru/cass-data/testfile' WITH DELIMITER='|' AND HEADER = TRUE;
Using 16 child processes
Starting copy of aarun.emp with columns [rownumber, cell, counternames, countervals, datetime, group] .
Failed to import 0 rows: NoHostAvailable - , given up after 1 attempts
Failed to import 0 rows: NoHostAvailable - , given up after 1 attempts
4 child process(es) died unexpectedly, aborting
Processed: 5000 rows; Rate: 593 rows/s; Avg. rate: 489 rows/s
5000 rows imported from 0 files in 10.227 seconds (0 skipped).
I have seen debug logs also but I don't see any info about why this child proess died. have enough resources, and the file I am loading is 109MB file.
cqlsh> COPY aarun.emp FROM '/home/etolaru/cass-data/testfile' WITH DELIMITER='|' AND HEADER = TRUE --debug;
Using 16 child processes
Starting copy of aarun.emp with columns [rownumber, cell, counternames, countervals, datetime, group] .
Failed to import 0 rows: NoHostAvailable - , given up after 1 attempts
Failed to import 0 rows: NoHostAvailable - , given up after 1 attempts
4 child process(es) died unexpectedly, aborting
Processed: 5000 rows; Rate: 593 rows/s; Avg. rate: 489 rows/s
5000 rows imported from 0 files in 10.227 seconds (0 skipped).
I expect all records in file should load into cassandra DB with out any issue.
Please suggest me how to fix this issue.
Make sure your file has proper encodings and there are no special characters in them (Ensure UTF-8, Haven't tested ASCII), To test it out, try loading the same file on a PostgreSQL Server since copy command shares a lot of similarity with PostgreSQL data dumps. This will help ensuring your input data has no issues, Also I read somewhere that "COPY FROM" should be limited to smaller files like 1-2 GB(Max) and not more.
I am facing multiple errors due to Commit log and sstables getting corrupted frequently in my write heavy system. Writes are around 50K rows/s. I have couple of questions around the same.
What are the common causes, why commit logs and sstables get corrupted often? How to debug this issue?
In my test system where I can bear loss of data, I can delete corrupted commit log file and restart service. How to handle this situation in production environment, with no loss of data?
Exception seen:
1.
ERROR [main] 2017-01-05 06:42:38,787 JVMStabilityInspector.java (line 78) Exiting due to error while processing commit log during initialization.
org.apache.cassandra.db.commitlog.CommitLogReplayer$CommitLogReplayException: Could not read commit log descriptor in file /a
/CommitLog-5-1483596903961.log
at org.apache.cassandra.db.commitlog.CommitLogReplayer.handleReplayError(CommitLogReplayer.java:623) [main/:na]
at org.apache.cassandra.db.commitlog.CommitLogReplayer.recover(CommitLogReplayer.java:303) [main/:na]
at org.apache.cassandra.db.commitlog.CommitLogReplayer.recover(CommitLogReplayer.java:147) [main/:na]
at org.apache.cassandra.db.commitlog.CommitLog.recover(CommitLog.java:189) [main/:na]
at org.apache.cassandra.db.commitlog.CommitLog.recover(CommitLog.java:169) [main/:na]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:303) [main/:na]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:543) [main/:na]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:652) [main/:na]
2.
org.apache.cassandra.db.commitlog.CommitLogReplayer$CommitLogReplayException: Mutation checksum failure at 96490970 in CommitLog-5-1483586548946.log