Skip to content

Commit d099213

Browse files
Remove OPENSHIFT_PROFILE as we now integrate debug directly
1 parent dab335c commit d099213

File tree

6 files changed

+17
-55
lines changed

6 files changed

+17
-55
lines changed

HACKING.md

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -762,39 +762,20 @@ Note: Hosted API documentation can be found
762762
## Performance debugging
763763

764764
OpenShift integrates the go `pprof` tooling to make it easy to capture CPU and
765-
heap dumps for running systems. The following modes are available for the
766-
`openshift` binary (including all the CLI variants):
765+
heap dumps for running systems. The pprof endpoint is available at `/debug/pprof/`
766+
on the secured HTTPS port for the `openshift` binary:
767767

768-
* `OPENSHIFT_PROFILE` environment variable:
769-
* `cpu` - will start a CPU profile on startup and write `./cpu.pprof`.
770-
Contains samples for the entire run at the native sampling resolution (100hz).
771-
Note: CPU profiling for Go does not currently work on Mac OS X - the stats are
772-
not correctly sampled
773-
* `mem` - generate a running heap dump that tracks allocations to
774-
`./mem.pprof`
775-
* `block` - will start a block wait time analysis and write `./block.pprof`
776-
* `web` - start the pprof webserver in process at http://127.0.0.1:6060/debug/pprof
777-
(you can open this in a browser). This supports `OPENSHIFT_PROFILE_HOST=`
778-
and `OPENSHIFT_PROFILE_PORT=` to change default ip `127.0.0.1` and default port `6060`.
779-
780-
In order to start the server in CPU profiling mode, run:
781-
782-
$ OPENSHIFT_PROFILE=cpu sudo ./_output/local/bin/linux/amd64/openshift start
783-
784-
Or, if running OpenShift under systemd, append this to
785-
`/etc/sysconfig/atomic-openshift-{master,node}`
786-
787-
OPENSHIFT_PROFILE=cpu
768+
$ oc get --raw /debug/pprof/profile --as=system:admin > cpu.pprof
788769

789770
To view profiles, you use
790771
[pprof](http://goog-perftools.sourceforge.net/doc/cpu_profiler.html) which is
791-
part of `go tool`. You must pass the binary you are debugging (for symbols)
792-
and a captured pprof. For instance, to view a `cpu` profile from above, you
793-
would run OpenShift to completion, and then run:
772+
part of `go tool`. You must pass the captured pprof file (for source lines
773+
you will need to build the binary locally). For instance, to view a `cpu` profile
774+
from above, you would run OpenShift to completion, and then run:
794775

795-
$ go tool pprof ./_output/local/bin/linux/amd64/openshift cpu.pprof
776+
$ go tool pprof cpu.pprof
796777
or
797-
$ go tool pprof $(which openshift) /var/lib/origin/cpu.pprof
778+
$ go tool pprof /var/lib/origin/cpu.pprof
798779

799780
This will open the `pprof` shell, and you can then run:
800781

@@ -817,19 +798,18 @@ to launch a web browser window showing you where CPU time is going.
817798
`pprof` supports CLI arguments for looking at profiles in different ways -
818799
memory profiles by default show allocated space:
819800

820-
$ go tool pprof ./_output/local/bin/linux/amd64/openshift mem.pprof
801+
$ go tool pprof mem.pprof
821802

822803
but you can also see the allocated object counts:
823804

824-
$ go tool pprof --alloc_objects ./_output/local/bin/linux/amd64/openshift
825-
mem.pprof
805+
$ go tool pprof --alloc_objects mem.pprof
826806

827807
Finally, when using the `web` profile mode, you can have the go tool directly
828-
fetch your profiles via HTTP:
808+
fetch your profiles via HTTP for services that only expose their profiling
809+
contents over an unsecured HTTP endpoint:
829810

830811
# for a 30s CPU trace
831-
$ go tool pprof ./_output/local/bin/linux/amd64/openshift
832-
http://127.0.0.1:6060/debug/pprof/profile
812+
$ go tool pprof http://127.0.0.1:6060/debug/pprof/profile
833813

834814
# for a snapshot heap dump at the current time, showing total allocations
835815
$ go tool pprof --alloc_space ./_output/local/bin/linux/amd64/openshift

hack/lib/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ function os::start::master() {
270270
os::log::debug "$( ps -ef | grep openshift )"
271271

272272
os::log::debug "Starting OpenShift server"
273-
local openshift_env=( "OPENSHIFT_PROFILE=${OPENSHIFT_PROFILE:-web}" "OPENSHIFT_ON_PANIC=crash" )
273+
local openshift_env=( "OPENSHIFT_ON_PANIC=crash" )
274274
$(os::start::internal::openshift_executable) start master \
275275
--loglevel=4 \
276276
--logspec='*importer=5' \

hack/test-cmd.sh

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,6 @@ os::log::system::start
5353
# Prevent user environment from colliding with the test setup
5454
unset KUBECONFIG
5555

56-
# handle profiling defaults
57-
profile="${OPENSHIFT_PROFILE-}"
58-
unset OPENSHIFT_PROFILE
59-
if [[ -n "${profile}" ]]; then
60-
if [[ "${TEST_PROFILE-}" == "cli" ]]; then
61-
export CLI_PROFILE="${profile}"
62-
else
63-
export WEB_PROFILE="${profile}"
64-
fi
65-
else
66-
export WEB_PROFILE=cpu
67-
fi
68-
69-
# profile the web
70-
export OPENSHIFT_PROFILE="${WEB_PROFILE-}"
7156
export ALLOWED_REGISTRIES='[{"domainName":"172.30.30.30:5000"},{"domainName":"myregistry.com"},{"domainName":"registry.centos.org"},{"domainName":"docker.io"},{"domainName":"gcr.io"},{"domainName":"quay.io"},{"domainName":"*.redhat.com"},{"domainName":"*.docker.io"},{"domainName":"registry.redhat.io"}]'
7257

7358
os::start::configure_server
@@ -79,9 +64,6 @@ os::test::junit::declare_suite_end
7964

8065
os::start::master
8166

82-
# profile the cli commands
83-
export OPENSHIFT_PROFILE="${CLI_PROFILE-}"
84-
8567
os::start::registry
8668

8769
export HOME="${FAKE_HOME_DIR}"

test/extended/alternate_certs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ os::util::sed "s/:7001$/:${ETCD_PEER_PORT}/g" master/master-config.yaml
4545
os::util::sed 's#^ namedCertificates: null# namedCertificates: [{"certFile":"custom.crt","keyFile":"custom.key","names":["localhost"]}]#' master/master-config.yaml
4646

4747
# Start master
48-
OPENSHIFT_PROFILE=web OPENSHIFT_ON_PANIC=crash openshift start master \
48+
OPENSHIFT_ON_PANIC=crash openshift start master \
4949
--config=master/master-config.yaml \
5050
--loglevel=4 \
5151
&>"${LOG_DIR}/openshift.log" &

test/extended/alternate_launches.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ sudo env "PATH=${PATH}" OPENSHIFT_ON_PANIC=crash openshift start etcd \
4444
&>"${LOG_DIR}/os-etcdserver.log" &
4545

4646
os::log::info "Starting api server"
47-
sudo env "PATH=${PATH}" OPENSHIFT_PROFILE=web OPENSHIFT_ON_PANIC=crash openshift start master api \
47+
sudo env "PATH=${PATH}" OPENSHIFT_ON_PANIC=crash openshift start master api \
4848
--config=${MASTER_CONFIG_DIR}/master-config.yaml \
4949
--loglevel=4 \
5050
&>"${LOG_DIR}/os-apiserver.log" &

test/old-start-configs/v1.0.0/test-end-to-end.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ echo "[INFO] Create certificates for the OpenShift server"
244244

245245

246246
echo "[INFO] Starting OpenShift server"
247-
sudo env "PATH=${PATH}" OPENSHIFT_PROFILE=web OPENSHIFT_ON_PANIC=crash openshift start \
247+
sudo env "PATH=${PATH}" OPENSHIFT_ON_PANIC=crash openshift start \
248248
--master-config=${MASTER_CONFIG_DIR}/master-config.yaml \
249249
--node-config=${NODE_CONFIG_DIR}/node-config.yaml \
250250
--loglevel=4 \

0 commit comments

Comments
 (0)