You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/15 15:09:19 UTC

[GitHub] [arrow] westonpace commented on a change in pull request #12624: ARROW-15617: [Doc][C++] Document environment variables

westonpace commented on a change in pull request #12624:
URL: https://github.com/apache/arrow/pull/12624#discussion_r827088337



##########
File path: docs/source/cpp/env_vars.rst
##########
@@ -0,0 +1,128 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+=====================
+Environment Variables
+=====================
+
+The following environment variables can be used to affect the behavior of
+Arrow C++ at runtime.  Many of these variables are inspected only once per
+process (for example, when the Arrow C++ DLL is loaded), so you cannot assume
+that changing their value later will have an effect.
+
+.. envvar:: ARROW_DEBUG_MEMORY_POOL
+
+   Enable rudimentary memory checks to guard against buffer overflows.
+   The value of this environment variable selects the behavior when a
+   buffer overflow is detected:
+
+   - ``abort`` exits the processus with a non-zero return value;
+   - ``trap`` issues a platform-specific debugger breakpoint / trap instruction;
+   - ``warn`` prints a warning on stderr and continues execution;
+   - an empty value disables memory checks.
+
+   .. note::
+      While this functionality can be useful and has little overhead, it
+      is not a replacement for more sophisticated memory checking utilities
+      such as `Valgrind <https://valgrind.org/>`_ or
+      `Address Sanitizer <https://clang.llvm.org/docs/AddressSanitizer.html>`_.
+
+.. envvar:: ARROW_DEFAULT_MEMORY_POOL
+
+   The backend to be used for the default :ref:`memory pool <cpp_memory_pool>`.
+   Possible values are among ``jemalloc``, ``mimalloc`` and ``system``,
+   depending on which backends were enabled when
+   :ref:`building Arrow C++ <building-arrow-cpp>`.
+
+.. envvar:: ARROW_LIBHDFS_DIR
+
+   The directory containing the C HDFS library (``hdfs.dll`` on Windows,
+   ``libhdfs.dylib`` on macOS, ``libhdfs.so`` on other platforms).
+   Alternatively, one can set :envvar:`HADOOP_HOME`.
+
+.. envvar:: ARROW_TRACING_BACKEND
+
+   The backend where to export `OpenTelemetry <https://opentelemetry.io/>`_-based
+   execution traces.  Possible values are:
+
+   - ``ostream``: emit textual log messages to stdout;
+   - ``otlp_http``: emit JSON traces to a HTTP server (by default, the endpoint
+     URL is "http://localhost:4318/v1/traces");
+   - ``arrow_otlp_stdout``: emit JSON traces to stdout;
+   - ``arrow_otlp_stderr``: emit JSON traces to stderr.
+
+   This environment variable has no effect if Arrow C++ was not built with
+   tracing enabled.
+
+   .. seealso::
+
+      `OpenTelemetry configuration for remote endpoints
+      <https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md>`__
+
+.. envvar:: ARROW_USER_SIMD_LEVEL
+
+   The SIMD optimization level to select.  By default, Arrow C++ detects
+   the capabilities of the current CPU at runtime and chooses the best
+   execution paths based on that information.  One can override the detection
+   by setting this environment variable to a well-defined value.
+   Supported values are:
+
+   - ``NONE`` disables any runtime-selected SIMD optimization;
+   - ``SSE4.2`` enables any SSE2-based optimizations until SSE4.2 (included);
+   - ``AVX`` enables any AVX-based optimizations and earlier;
+   - ``AVX2`` enables any AVX2-based optimizations and earlier;
+   - ``AVX512`` enables any AVX512-based optimizations and earlier.
+
+   This environment variable only has an effect on x86 platforms.  Other
+   platforms currently do not implement any form of runtime dispatch.
+
+   .. note::
+      In addition to runtime dispatch, the compile-time SIMD level can
+      be set using the ``ARROW_SIMD_LEVEL`` CMake configuration variable.
+      Unlike runtime dispatch, compile-time SIMD optimizations cannot be
+      changed at runtime (for example, if you compile Arrow C++ with AVX512
+      enabled, the resulting binary will only run on AVX512-enabled CPUs).
+
+.. envvar:: GANDIVA_CACHE_SIZE
+
+   The number of entries to keep in the Gandiva JIT compilation cache.
+   The cache is in-memory and does not persist accross processes.
+
+.. envvar:: HADOOP_HOME
+
+   The path to the Hadoop installation.
+
+.. envvar:: JAVA_HOME
+
+   The path to the Java Runtime Environment installation.  This may be
+   required for HDFS support if Java is installed in a non-standard location.
+
+.. envvar:: OMP_NUM_THREADS
+
+   The number of worker threads in the global (process-wide) CPU thread pool.
+   If this environment variable is not defined, the available hardware
+   concurrency is determined using a platform-specific routine.

Review comment:
       At the moment I think it is very important this is configurable.  So I am +1 on being able to expose this via an environment variable.  We have had at least one customer that was using S3 and benefited from setting this larger than the initial default.
   
   At some point though I think we want to move towards having I/O context / thread pools specific to the filesystem.  A single global default doesn't make a lot of sense when you might have a mix of local and remote workloads.  Even then I suppose we might still have a global default as a fallback in case the user doesn't specify anything.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org