#!/bin/bash #============================================================================== # 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 #------------------------------------------------------------------------------ # Set P4PORT and P4USER and run p4 login before running this script. # Verify instance value INSTANCE=$1 if [[ -n "$INSTANCE" ]]; then source /p4/common/bin/p4_vars $INSTANCE else echo "Error: An instance argument is required." exit 1 fi # Basic secruity features. p4 configure set run.users.authorize=1 # The server.depot.root configurable was introduced in 2014.1. if [[ "$P4D_VERSION" > "2014.1" ]]; then p4 configure set server.depot.root=$DEPOTS fi p4 configure set journalPrefix=$CHECKPOINTS/p4_${INSTANCE} p4 configure set dm.user.noautocreate=2 p4 configure set dm.user.resetpassword=1 p4 configure set filesys.P4ROOT.min=5G p4 configure set filesys.depot.min=5G p4 configure set filesys.P4JOURNAL.min=5G p4 configure set server=3 p4 configure set monitor=1 # For P4D 2013.2+, setting db.reorg.disable=1 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. It should be considered. ### [[ "$P4D_VERSION" > "2013.1" ]] && p4 configure set db.reorg.disable=1 # Set net.tcpsize when P4D is 2014.2 or less. In 2014.2 # the default changes from 2014.1, and this configurable # is best not set explicitly. [[ "$P4D_VERSION" < "2014.2" ]] && p4 configure set net.tcpsize=512k p4 configure set lbr.autocompress=1 p4 configure set lbr.bufsize=1M p4 configure set serverlog.file.3=$LOGS/errors.csv p4 configure set serverlog.retain.3=$KEEPLOGS p4 configure set serverlog.file.4=$LOGS/audit.csv p4 configure set serverlog.retain.4=$KEEPLOGS p4 configure set serverlog.file.7=$LOGS/events.csv p4 configure set serverlog.retain.7=$KEEPLOGS p4 configure set serverlog.file.8=$LOGS/integrity.csv p4 configure set serverlog.retain.8=$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 # Load shedding and other performance-preserving configurable. # See: http://answers.perforce.com/articles/KB/1272 # For p4d 2013.1+ [[ "$P4D_VERSION" > "2013.1" ]] && p4 configure set server.maxcommands=2500 # For p4d 2013.2+ -Turn off max* commandline overrides. [[ "$P4D_VERSION" > "2013.2" ]] && p4 configure set server.commandlimits=2 echo See http://www.perforce.com/perforce/doc.current/manuals/p4dist/chapter.replication.html#replication.verifying echo if you are also setting up a replica server. p4 configure set rpl.checksum.auto=1 p4 configure set rpl.checksum.change=2 p4 configure set rpl.checksum.table=1 # 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 netagive. # server.global.views - makes client views global in a commit/edge or cluster environment. if [[ "$P4D_VERSION" > "2015.2" ]]; then p4 configure set rpl.compress=4 p4 configure set server.global.client.views=1 elif [[ "$P4D_VERSION" > "2011.1" ]]; then p4 configure set rpl.compress=3 fi p4 counter SDP_DATE `date "+%Y-%m-%d"` p4 counter SDP_VERSION "$SDP_VERSION" echo -e "\nIt is recommended that you run 'p4 configure set security=3' or\n'p4 configure set security=4'.\nSee: http://www.perforce.com/perforce/doc.current/manuals/p4sag/chapter.superuser.html#DB5-49899\n"
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 19278 | trina | "Forking branch Main of perforce-software-sdp to trina-sdp." | ||
//guest/perforce_software/sdp/main/Server/setup/configure_new_server.sh | |||||
#14 | 18961 | C. Thomas Tyler | Released: SDP/MultiArch/2016.1/18958 (2016/04/08). | ||
#13 | 16807 | Russell C. Jackson (Rusty) | Merged approved changes in from dev. | ||
#12 | 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 |
||
#11 | 16276 | Russell C. Jackson (Rusty) | Bumped mins up to 5G | ||
#10 | 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. |
||
#9 | 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 |
||
#8 | 12112 | Russell C. Jackson (Rusty) | Increased maxcommands to 2500 and dropped maxwait to 600. | ||
#7 | 12106 | C. Thomas Tyler |
Corrected annoying but otherwise harmless warnings due to having Windows batch style comments in the Unix shell script. |
||
#6 | 12029 | C. Thomas Tyler |
Clarified appropriate P4D version string checks in *.sh version, and made cosmetic tweaks to *.sh and *.bat versions. |
||
#5 | 12026 | C. Thomas Tyler |
Updated a few configurables, including net.maxwait that may help prevent P4EXP from building up idle prococesses on p4d. |
||
#4 | 11722 | adrian_waters |
Remove redundant version-specific setting of monitor: [[ "$P4D_VERSION" > "2014.1" ]] && p4 configure set monitor=1 Script subsequently sets monitor=1 independant of version |
||
#3 | 11524 | Russell C. Jackson (Rusty) | Released updated version of the SDP from Dev. | ||
#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. |