Post by Arnt GulbrandsenA roundtrip means that a packet travels there, and a reply travels back.
There is an unstated implication that the packet's originator (e.g.
p4p) does nothing meanwhile, but just waits for the reply.
p4p probably does something like that for each file. Perhaps it tells
p4d "I'm now giving client foobar file //depot/mumble/stumble#42, which
I had in cache", and then p4d answers "OK, I recorded that in db.have"
and then they go on to the next file. In that case, there is exactly
one roundtrip per file change, so if 3000 files are to be changed, p4p
has to wait 3000 times. Each wait is as long as the roundtrip ping
reports.
Ok, that's just how I understood it the first time anyway. So my
suggestion about the ssh tunnel was still valid ;)
Even though you're right about two things. Of course it will not cause
miracles. If I'd know how to do miracles, I would not work for money
anymore :)
And second, the p4p opens just one connection to the server and reuses
that. I verified it, and it's correct. So I think you're right, ditch
the tunnel idea :(
Post by Arnt GulbrandsenIf p4p were to instead tell p4d "I'm now giving client foobar the
following dozen files, which I have in cache: ..." and p4d were to
answer "OK, recorded in db.have", then one roundtrip would serve to
handle a dozen file changes, and the whole operation would be almost a
dozen times faster. Handling 3000 files would require waiting just 250
times.
Perfectly right. Alas, right now we have to deal with what we have.
Post by Arnt GulbrandsenPost by Ralf HuvendiekIn fact I just tried the p4p here. After having synced against a depot
and the cache is loaded, it will make exactly one connection if I try
to sync again. Of course this would be different, if my cache would
not be up to date.
Is your p4p far from your p4d? What is the roundtrip ping reports
between those two hosts?
I had synced against public.perforce.com (cough, cough)
--- alameda0c.perforce.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 221.924/224.352/227.530/2.380 ms
Post by Arnt GulbrandsenOne good way to observe this is to run "p4 sync ...#none" and then "p4
sync ...". Typical commands for a build script.
I tried it again. And noticed an few things.
p4 sync #none takes quite some times. tcpdump show some interaction
between the host and my proxy.
p4 sync takes the hell of some time. There's a quite a lot of
communication between the host and the proxy. And now the really nasty
part. I am very suspicious that the proxy does not save all files.
Instead some of the big files are transfered again and again.
My cache has 8 times less files as my workspace after syncing. And from
the delay for some files during sync I'd swear that they're
retransfered. Plus I am unable to find the files in my cache afterwards.
Strange thing. Maybe I did something wrong, I started the proxy with
./p4p -r /tmp/p4cache -t public.perforce.com:1666 -e 0
What I learnt today: Never sync to #none. But do incremental syncs. In
fact is this is one thing I'm looking forward to. Right now we're still
using old PVCS and, speaking in perforce terms, we sync to #none and
then to #head when updating. This pretty much sucks. Because it takes
long enough to be an annoyance (not 6 hours, if I'd to wait 6 hours, I
would kill someone ;)).
*Attention, nasty hack suggestions coming up*
Assuming that the communication between the remote site and the server
is a problem. What about syncing each client on the site where the
server lives, than letting each user download his 'workspace' from
there?
I can think up a few workaround here.
'sync' is always local, that is the site where the perforce server is
located.
-sync to #none, then to #head. Afterwards the user can use tools like
rsync to sync his local workspace to the remote one. rsync should only
transfer the modified files. And from those only the modified parts.
-like above. But zip the resulting workspace and let the user download
this one. In fact we're doing something like this right now, because our
old PVCS version is such a network whore. Downside: The user has to
download the whole zip file. Which can be quite huge and much more than
using the rsync method.
-skip the sync to #none and just sync to #head. You should end up with
just the new files the user needs. After this zip or rsync.
Or course there are some downsides. I did say 'nasty hack solution', did
I? :)
- If the user does not properly sync his workstation with the one on the
remote fileserver, his workspace will be pretty much toast. As the
server 'thinks' he has newer files than he already has.
- If you have a lot of user/workspaces on your remote site, you could
need a pretty much big ass hd for all the files your remote users will
get each night.
- Another thing I forgot?
Ralf