@ECHO OFF :: ============================================================================ :: This script serves as a guide defining best-practice configurables for a :: production environment. See documentation regarding configurables here: :: https://www.perforce.com/perforce/doc.current/manuals/cmdref/Content/CmdRef/configurables.configurables.html :: :: Copyright and license info is available in the LICENSE file included with :: the Server Deployment Package (SDP), and also available online: :: https://swarm.workshop.perforce.com/projects/perforce-software-sdp/view/main/LICENSE :: ---------------------------------------------------------------------------- REM Set P4PORT and P4USER and run p4 login before running this script. :: Verify instance value if %1x==x ( echo Error: The SDP instance argument is required. echo . exit /b 1 ) SET instance=%1 call C:\p4\common\bin\p4env.bat %1 @ECHO ON C:\p4\common\bin\svcinst.exe start -n p4_%instance% :: The server.depot.root configurable is valid for P4D 2014.1+ p4 configure set server.depot.root=c:\p4\%instance%\depots p4 configure set journalPrefix=%CHECKPOINTS_DIR%\p4_%instance% :: The db.peeking configurable is valid for P4D 2013.3+ p4 configure set db.peeking=3 p4 configure set dm.user.noautocreate=2 p4 configure set dm.info.hide=1 p4 configure set filesys.P4ROOT.min=5G p4 configure set filesys.depot.min=5G p4 configure set filesys.P4JOURNAL.min=5G :: Note: With the SDP structure, filesys.P4LOG.min=5G and :: filesys.TEMP.min=5G don't need to be set, as they are :: stored on the same volume as the journal and are thus :: accounted for with filesys.P4JOURNAL.min. p4 configure set server=3 p4 configure set monitor=2 :: For P4D 2015.2+, make client views global in a commit/edge environment. p4 configure set server.global.client.views=1 :: For P4D 2013.2+, setting db.reorg.disable=1, which turns off :: dynamic database reorg, has been shown to significantly improve :: performance when Perforce databases (db.* files) are stored on :: some solid state storage devices, while not making a difference :: on others. p4 configure set db.reorg.disable=1 :: For P4D 2017.2.1594901 or greater, enable net.autotune. For net.autotune :: to take effect, it must be enabled on both sides of a connection. So, to :: get the full benefit, net.autotune must be enabled on all brokers, proxies, :: and clients. See this KB article for details on fully enabling net.autotune: :: https://portal.perforce.com/s/article/15368 :: :: For connections in which net.autotune is not enabled, the p4d default value :: of net.tcpsize takes effect. :: :: When P4D is older than 2014.2 but less than 2017.2.1594901, set net.tcpsize :: to 512k. In 2014.2, the default value for net.tcpsize became 512k, a :: reasonable default, so it should not be set explicitly. Also, there are :: indications it can reduce performance if set when not needed. p4 configure set net.autotune=1 p4 configure unset net.tcpsize :: For connections in which net.autotune is not enabled, the p4d default value :: of net.tcpsize takes effect. :: :: When P4D is older than 2014.2 but less than 2017.2.1594901, set net.tcpsize :: to 512k. In 2014.2, the default value for net.tcpsize became 512k, a :: reasonable default, so it should not be set explicitly. Also, there are :: indications it can reduce performance if set when not needed. p4 configure unset net.tcpsize :: For P4D 2016.2.1468155+, set db.monitor.shared = max value. :: This is the number of 8k pages to set aside for monitoring, :: which requires pre-allocation of sufficient RAM. The default :: is 256, or 2MB, enough for about 128 active/concurrent processes. :: The max as of 2016.2 is 4096. Setting db.monitor.shared=0 :: causes the db.monitor on disk to be used instead, which can :: potentially be a bottleneck. p4 configure set db.monitor.shared=4096 p4 configure set net.backlog=2048 p4 configure set lbr.bufsize=1M p4 configure set lbr.autocompress=1 p4 configure set filesys.bufsize=1M p4 configure set serverlog.file.4=%LOGS_DIR%\audit.csv p4 configure set serverlog.retain.4=%KEEPLOGS% p4 configure set serverlog.maxmb.4=200 p4 configure set serverlog.file.8=%LOGS_DIR%\integrity.csv p4 configure set serverlog.retain.8=%KEEPLOGS% :: Add a custom trigger for tracking trigger events: p4 configure set serverlog.events.11=11 p4 configure set serverlog.file.11=%LOGS_DIR%\triggers.csv p4 configure set serverlog.retain.11=%KEEPLOGS% @echo "Creating a depot named 'spec' of type 'spec'. p4 depot -i < spec.depot.p4s @echo "Creating a depot named 'unload' of unload 'unload'. p4 depot -i < unload.depot.p4s :: For p4d 2013.2+ -Turn off max* commandline overrides. p4 configure set server.commandlimits=2 @echo See: https://portal.perforce.com/s/article/3867 p4 configure set rpl.checksum.auto=1 p4 configure set rpl.checksum.change=2 p4 configure set rpl.checksum.table=1 :: Define number of login attempts before there is a delay, to thwart :: automated password crackers. Default is 3; set to a higher value to :: be more friendly to humans without compromising the protection. p4 configure set dm.user.loginattempts=7 :: For p4d 2016.1 Patch 5+ :: Enable a server with an expired temp license to start, albeit with limited :: functionality, so that license expiry doesn't make it impossible to perform :: license management via the front-door. This configurable allows the server :: to be started regardless of a bad license, though users will still be blocked :: by license invalid messages. Perpetual commercial licenses never expire; :: this configurable will not affect those. p4 configure set server.start.unlicensed=1 :: Starting with p4d 2015.1 Patch 5, disallow P4EXP v2014.2 (a client :: version known to misbehave) from connecting to the server. :: See: http://portal.perforce.com/articles/KB/15014 p4 configure set rejectList="P4EXP,version=2014.2" :: For p4d 2011.1 thru 2015.1, set rpl.compress=3. For p4d 2015.2+, set :: rpl.compress=4. This setting compresses journal data only, which is :: almost always advantageous as it compresses well, while avoiding :: compression of archive data, which is a mixed bag in terms of performance :: benefits, and potentially a net negative. p4 configure set rpl.compress=4 :: Starting with p4d 2016.2, enable these features. p4 configure set server.locks.global=1 p4 configure set proxy.monitor.level=3 :: Recommended for Swarm p4 configure set dm.shelve.promote=1 p4 configure set dm.keys.hide=2 p4 configure set filetype.bypasslock=1 :: Starting with p4d 2018.2 (as tech-preview, 2019.2 for GA), add best :: practices for Extensions. p4 configure set server.extensions.dir=c:\p4\%instance%\logs\p4-extensions :: Set configurables to optimize for Helix Authentication Service (HAS) :: deployment. These will also affect behavior of older `auth-check-sso` :: triggers. :: For p4d 2018.2+ p4 configure set auth.sso.allow.passwd=1 p4 configure set auth.sso.nonldap=1 :: Enable parallelization. p4 configure set net.parallel.max=10 p4 configure set net.parallel.threads=4 :: Limit max parallel syncs. p4 configure set net.parallel.sync.svrthreads=150 :: Enable partitioned clients. p4 configure set client.readonly.dir=c:\p4\%instance%\root\client.readonly.dir p4 configure set client.sendq.dir=c:\p4\%instance%\root\client.readonly.dir :: Starting with p4d 2016.1, use auth.id to simplify ticket handling. :: After setting auth.id, login again. p4 configure set rpl.forward.login=1 p4 configure set auth.id=p4_%instance% p4login.bat %1 :: Set SDP version identifying info. p4 counter SDP "%DATE%" :: The filesys.atomic.rename feature is enabled by default in P4D 2023.2. :: This feature is preferred when it can be used, but does not work in :: all storage configurations. It is set to zero here to ensure journal :: rotations and checkpoints always work. If you determine that journal :: rotations work with atomic rename enabled in the current environment, :: this configurable can be set to 1. p4 configure set filesys.atomic.rename=0 :: Basic security features. p4 configure set run.users.authorize=1 p4 configure set security=4 :: Restart to ensure all configurable changes take effect. C:\p4\common\bin\svcinst.exe stop -n p4_%instance% C:\p4\common\bin\svcinst.exe start -n p4_%instance% p4login.bat %1 @echo The net.autotune value has been set on the server. To get the full benefit, it must also be @echo enabled on proxies, brokers, and clients as well.
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#38 | 30297 | C. Thomas Tyler |
Released SDP 2023.2.30295 (2024/05/08). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#37 | 30043 | C. Thomas Tyler |
Released SDP 2023.2.30041 (2023/12/22). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#36 | 29954 | C. Thomas Tyler |
Released SDP 2023.1.29949 (2023/12/01). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#35 | 29891 | C. Thomas Tyler |
Released SDP 2023.1.29699 (2023/07/11). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#34 | 29612 | C. Thomas Tyler |
Released SDP 2023.1.29610 (2023/05/25). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#33 | 28651 | C. Thomas Tyler |
Released SDP 2021.2.28649 (2022/03/03). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#32 | 28240 | C. Thomas Tyler |
Released SDP 2021.1.28238 (2021/11/12). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#31 | 27761 | C. Thomas Tyler |
Released SDP 2020.1.27759 (2021/05/07). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#30 | 27527 | C. Thomas Tyler |
Released SDP 2020.1.27524 (2021/02/26). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#29 | 27331 | C. Thomas Tyler |
Released SDP 2020.1.27325 (2021/01/29). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#28 | 26161 | C. Thomas Tyler |
Released SDP 2019.3.26159 (2019/11/06). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#27 | 25933 | C. Thomas Tyler |
Released SDP 2019.2.25923 (2019/08/05). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#26 | 25245 | C. Thomas Tyler |
Released SDP 2019.1.25238 (2019/03/02). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#25 | 23510 | C. Thomas Tyler |
Released SDP 2018.1.23504 (2018/01/19). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev', with selective removal of work-in-progress files. |
||
#24 | 23331 | C. Thomas Tyler |
Released SDP 2017.4.23329 (2017/12/05). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#23 | 23006 | C. Thomas Tyler |
Released SDP 2017.3.23003 (2017/10/19). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#22 | 22685 | Russell C. Jackson (Rusty) | Update main with current changes from dev. | ||
#21 | 22185 | C. Thomas Tyler |
Released SDP 2017.2.22177 (2017/05/17). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#20 | 21723 | C. Thomas Tyler |
Released SDP 2017.1.21720 (2017/02/17). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#19 | 21483 | C. Thomas Tyler |
Released SDP 2016.2.21480 (2017/01/11). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#18 | 21381 | C. Thomas Tyler |
Released SDP 2016.2.21379 (2016/12/20). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#17 | 21244 | C. Thomas Tyler |
Released SDP 2016.2.21239 (2016/12/06). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#16 | 21193 | Russell C. Jackson (Rusty) | Update main from dev. | ||
#15 | 20353 | C. Thomas Tyler |
Released SDP 2016.1.20348. Copy Up using 'p4 copy -r -b perforce_software-sdp-dev', with selective removal of changes related to work-in-progress changes. |
||
#14 | 19841 | C. Thomas Tyler |
Released SDP 2016.1.19838 (2016/06/26). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#13 | 19694 | C. Thomas Tyler |
Released SDP/MultiArch/2016.1/19661 (2016/06/08). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#12 | 19414 | C. Thomas Tyler | Released SDP/MultiArch/2016.1/19410 (2016/05/17). | ||
#11 | 18961 | C. Thomas Tyler | Released: SDP/MultiArch/2016.1/18958 (2016/04/08). | ||
#10 | 16807 | Russell C. Jackson (Rusty) | Merged approved changes in from dev. | ||
#9 | 16459 | C. Thomas Tyler |
For p4d 2011.1 thru 2015.1, set rpl.compress=3. For p4d 2015.2+, set rpl.compress=4. A value of 4, new in P4D 2015.2, compresses journal data only, which is almost always advantageous as it compresses well, while avoiding compression of archive data, which is a mixed bag in terms of performance benefits, and potentially a net netagive. #review @scommon |
||
#8 | 16282 | Russell C. Jackson (Rusty) | Added lbr.autocompress=1 and changed limit daily checkpoints to false. | ||
#7 | 16276 | Russell C. Jackson (Rusty) | Bumped mins up to 5G | ||
#6 | 15856 | C. Thomas Tyler |
Replaced the big license comment block with a shortened form referencing the LICENSE file included with the SDP package, and also by the URL for the license file in The Workshop. |
||
#5 | 15552 | C. Thomas Tyler |
Removed net.maxwait setting. Considerations: * Our KB Article says not to set it: http://answers.perforce.com/articles/KB/3751 * The value of 600 (10 mintues) was too low, and was observed to break replication. * This was originally thought to be a server-side 'zombie process' defense, but it has undesirable side-effects. #review-15553 |
||
#4 | 12029 | C. Thomas Tyler |
Clarified appropriate P4D version string checks in *.sh version, and made cosmetic tweaks to *.sh and *.bat versions. |
||
#3 | 12026 | C. Thomas Tyler |
Updated a few configurables, including net.maxwait that may help prevent P4EXP from building up idle prococesses on p4d. |
||
#2 | 11408 | C. Thomas Tyler |
Added recommended SDP setting setting of db.reorg.disable=1. It is commented out by default, with a comment indicating that the db.reorg.disable configurable should be considered when databases are stored on solid state storage, as it results in performance improvement for some (but not all) solid state storage devices. #review-11175 @michael_shields Updated from first shelve for review: * Changed version from 2014.2 to 2013.2. * Fixed grammatical error in comment. * Corrected comment style to Windows for *.bat file ('#' --> '::'). Updated from second shelve for review: * Updated comments above and in the code based on feedback, especially that the performance improvement is not universal on all solid state devices. |
||
#1 | 10148 | C. Thomas Tyler | Promoted the Perforce Server Deployment Package to The Workshop. |