passenger 5.1.4 → 5.1.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.editorconfig +9 -0
- data/CHANGELOG +9 -0
- data/build/cxx_tests.rb +11 -1
- data/build/documentation.rb +0 -32
- data/build/support/cxx_dependency_map.rb +602 -2
- data/build/test_basics.rb +3 -3
- data/dev/boost-patches/0001-Patch-boost-thread-so-that-oxt-thread-can-use-it.patch +48 -0
- data/dev/boost-patches/0002-Make-boost-thread_interrupted-derive-from-oxt-tracab.patch +33 -0
- data/dev/boost-patches/0003-Disable-a-Clang-pragma-to-prevent-warnings-on-OS-X.patch +25 -0
- data/dev/ci/README.md +121 -0
- data/dev/ci/lib/functions.sh +129 -0
- data/dev/ci/lib/set-container-envvars.sh +46 -0
- data/dev/ci/lib/setup-container.sh +43 -0
- data/dev/ci/run-tests-natively +24 -0
- data/dev/ci/run-tests-with-docker +42 -0
- data/dev/ci/scripts/debug-console-wrapper.sh +27 -0
- data/dev/ci/scripts/docker-entrypoint-stage2.sh +17 -0
- data/dev/ci/scripts/docker-entrypoint.sh +17 -0
- data/dev/ci/scripts/inituidgid +17 -0
- data/dev/ci/scripts/run-tests-natively-stage2.sh +17 -0
- data/dev/ci/scripts/setup-host-natively.sh +11 -0
- data/dev/ci/setup-host +50 -0
- data/dev/ci/tests/apache2/run +6 -0
- data/dev/ci/tests/apache2/setup +4 -0
- data/dev/ci/tests/cxx/run +9 -0
- data/dev/ci/tests/cxx/setup +4 -0
- data/dev/ci/tests/nginx-dynamic/run +20 -0
- data/dev/ci/tests/nginx-dynamic/setup +4 -0
- data/dev/ci/tests/nginx/run +5 -0
- data/dev/ci/tests/nginx/setup +4 -0
- data/dev/ci/tests/nodejs/run +4 -0
- data/dev/ci/tests/nodejs/setup +4 -0
- data/dev/ci/tests/ruby/run +4 -0
- data/dev/ci/tests/ruby/setup +4 -0
- data/dev/ci/tests/source-packaging/run +4 -0
- data/dev/ci/tests/source-packaging/setup +4 -0
- data/dev/ci/tests/standalone/run +4 -0
- data/dev/ci/tests/standalone/setup +4 -0
- data/dev/copy_boost_headers +8 -2
- data/src/agent/Core/ApiServer.h +11 -5
- data/src/agent/Core/Controller.h +12 -46
- data/src/agent/Core/Controller/CheckoutSession.cpp +1 -1
- data/src/agent/Core/Controller/Config.h +369 -0
- data/src/agent/Core/Controller/ForwardResponse.cpp +4 -4
- data/src/agent/Core/Controller/Hooks.cpp +15 -3
- data/src/agent/Core/Controller/Implementation.cpp +1 -1
- data/src/agent/Core/Controller/InitRequest.cpp +28 -39
- data/src/agent/Core/Controller/InitializationAndShutdown.cpp +25 -60
- data/src/agent/Core/Controller/InternalUtils.cpp +0 -16
- data/src/agent/Core/Controller/Miscellaneous.cpp +0 -17
- data/src/agent/Core/Controller/Request.h +2 -0
- data/src/agent/Core/Controller/SendRequest.cpp +4 -4
- data/src/agent/Core/Controller/{StateInspectionAndConfiguration.cpp → StateInspection.cpp} +0 -22
- data/src/agent/Core/Controller/TurboCaching.h +11 -10
- data/src/agent/Core/CoreMain.cpp +16 -6
- data/src/agent/Core/ResponseCache.h +3 -3
- data/src/agent/Core/SpawningKit/SmartSpawner.h +9 -3
- data/src/agent/Core/SpawningKit/Spawner.h +7 -3
- data/src/agent/UstRouter/ApiServer.h +3 -2
- data/src/agent/UstRouter/Controller.h +66 -32
- data/src/agent/UstRouter/UstRouterMain.cpp +10 -2
- data/src/agent/Watchdog/ApiServer.h +3 -2
- data/src/agent/Watchdog/WatchdogMain.cpp +3 -1
- data/src/apache2_module/ConfigurationCommands.cpp +1 -1
- data/src/cxx_supportlib/ConfigKit/Common.h +125 -0
- data/src/cxx_supportlib/ConfigKit/ConfigKit.h +34 -0
- data/src/cxx_supportlib/ConfigKit/README.md +895 -0
- data/src/cxx_supportlib/ConfigKit/Schema.h +331 -0
- data/src/cxx_supportlib/ConfigKit/Store.h +385 -0
- data/src/cxx_supportlib/ConfigKit/TableTranslator.h +185 -0
- data/src/cxx_supportlib/ConfigKit/Utils.h +141 -0
- data/src/cxx_supportlib/ConfigKit/VariantMapUtils.h +81 -0
- data/src/cxx_supportlib/Constants.h +1 -1
- data/src/cxx_supportlib/Crypto.cpp +2 -2
- data/src/cxx_supportlib/Logging.h +0 -35
- data/src/cxx_supportlib/ServerKit/HttpServer.h +35 -16
- data/src/cxx_supportlib/ServerKit/Server.h +65 -25
- data/src/cxx_supportlib/oxt/macros.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/replace.hpp +0 -2
- data/src/cxx_supportlib/vendor-modified/boost/array.hpp +53 -42
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/atomic_template.hpp +11 -5
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/bitwise_cast.hpp +13 -2
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/caps_gcc_x86.hpp +23 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/caps_msvc_x86.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/config.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/interlocked.hpp +8 -1
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_emulated.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_alpha.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_arm.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_atomic.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_ppc.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_sparc.hpp +6 -4
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_sync.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_x86.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_x86_dcas.hpp +28 -17
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_linux_arm.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_msvc_arm.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_msvc_x86.hpp +9 -4
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/platform.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/bind/arg.hpp +10 -3
- data/src/cxx_supportlib/vendor-modified/boost/bind/bind.hpp +90 -18
- data/src/cxx_supportlib/vendor-modified/boost/cerrno.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/chrono/duration.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/auto_link.hpp +8 -3
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/borland.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang.hpp +35 -6
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/codegear.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/comeau.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/common_edg.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/compaq_cxx.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/cray.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/digitalmars.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/gcc.hpp +19 -4
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/gcc_xml.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/greenhills.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/hp_acc.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/intel.hpp +29 -7
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/kai.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/metrowerks.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/mpw.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/nvcc.hpp +16 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/pathscale.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/pgi.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/sgi_mipspro.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/sunpro_cc.hpp +10 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/vacpp.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/visualc.hpp +44 -16
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/xlcpp.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/cygwin.hpp +1 -2
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/linux.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/select_compiler_config.hpp +21 -21
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/dinkumware.hpp +42 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libcomo.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libcpp.hpp +40 -7
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libstdcpp3.hpp +39 -6
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/modena.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/msl.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/roguewave.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/sgi.hpp +8 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/stlport.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/vacpp.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/suffix.hpp +33 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/adaptive_pool.hpp +0 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +0 -3
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator_traits.hpp +34 -27
- data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +62 -26
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/addressof.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/advanced_insert_int.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/compare_functors.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_begin.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/construct_in_place.hpp +39 -5
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +49 -32
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/dispatch_uses_allocator.hpp +175 -7
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +223 -98
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_sorted.hpp +57 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterators.hpp +88 -41
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/mpl.hpp +7 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/mutex.hpp +4 -9
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_alloc_holder.hpp +45 -18
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pair.hpp +205 -26
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/tree.hpp +290 -181
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/value_init.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/variadic_templates_tools.hpp +24 -19
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +38 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/flat_map.hpp +320 -46
- data/src/cxx_supportlib/vendor-modified/boost/container/flat_set.hpp +91 -18
- data/src/cxx_supportlib/vendor-modified/boost/container/list.hpp +23 -19
- data/src/cxx_supportlib/vendor-modified/boost/container/map.hpp +491 -120
- data/src/cxx_supportlib/vendor-modified/boost/container/new_allocator.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/node_allocator.hpp +0 -3
- data/src/cxx_supportlib/vendor-modified/boost/container/node_handle.hpp +399 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/deque.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/flat_map.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/flat_set.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/list.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/map.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/set.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/slist.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/small_vector.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/stable_vector.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/string.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/vector.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/set.hpp +101 -20
- data/src/cxx_supportlib/vendor-modified/boost/container/slist.hpp +19 -14
- data/src/cxx_supportlib/vendor-modified/boost/container/small_vector.hpp +117 -59
- data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +8 -6
- data/src/cxx_supportlib/vendor-modified/boost/container/static_vector.hpp +33 -28
- data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +414 -70
- data/src/cxx_supportlib/vendor-modified/boost/container/throw_exception.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator_fwd.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +134 -117
- data/src/cxx_supportlib/vendor-modified/boost/core/addressof.hpp +202 -99
- data/src/cxx_supportlib/vendor-modified/boost/core/demangle.hpp +8 -10
- data/src/cxx_supportlib/vendor-modified/boost/core/lightweight_test.hpp +217 -1
- data/src/cxx_supportlib/vendor-modified/boost/core/scoped_enum.hpp +29 -27
- data/src/cxx_supportlib/vendor-modified/boost/current_function.hpp +5 -1
- data/src/cxx_supportlib/vendor-modified/boost/date_time/c_time.hpp +13 -13
- data/src/cxx_supportlib/vendor-modified/boost/date_time/constrained_value.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/date_time/date.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/date_time/date_duration.hpp +4 -3
- data/src/cxx_supportlib/vendor-modified/boost/date_time/date_duration_types.hpp +6 -5
- data/src/cxx_supportlib/vendor-modified/boost/date_time/date_facet.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/date_time/date_names_put.hpp +8 -7
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_calendar.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_date.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_day.hpp +4 -3
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_day_of_year.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_duration.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_duration_types.hpp +4 -3
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_facet.hpp +27 -7
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_month.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_serialize.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_weekday.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_year.hpp +4 -5
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian_calendar.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/date_time/local_time/local_date_time.hpp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/date_time/local_time/posix_time_zone.hpp +4 -3
- data/src/cxx_supportlib/vendor-modified/boost/date_time/period.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/date_duration_operators.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/posix_time_config.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/posix_time_duration.hpp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/ptime.hpp +6 -5
- data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/time_parsers.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/date_time/time_duration.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/date_time/time_facet.hpp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/date_time/time_zone_base.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/date_time/year_month_day.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/detail/iterator.hpp +13 -0
- data/src/cxx_supportlib/vendor-modified/boost/detail/lcast_precision.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/detail/workaround.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/exception/detail/error_info_impl.hpp +11 -0
- data/src/cxx_supportlib/vendor-modified/boost/exception/detail/shared_ptr.hpp +17 -0
- data/src/cxx_supportlib/vendor-modified/boost/exception/exception.hpp +25 -3
- data/src/cxx_supportlib/vendor-modified/boost/exception/get_error_info.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/exception/info.hpp +114 -1
- data/src/cxx_supportlib/vendor-modified/boost/function/function_base.hpp +116 -142
- data/src/cxx_supportlib/vendor-modified/boost/function/function_template.hpp +57 -69
- data/src/cxx_supportlib/vendor-modified/boost/functional/hash/detail/hash_float.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/functional/hash/extensions.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/functional/hash/hash.hpp +27 -13
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/any_hook.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/avl_set.hpp +99 -12
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/avl_set_hook.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/avltree.hpp +35 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/avltree_algorithms.hpp +37 -6
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/bs_set.hpp +95 -8
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/bs_set_hook.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/bstree.hpp +209 -72
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/bstree_algorithms.hpp +86 -20
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/circular_list_algorithms.hpp +11 -11
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/circular_slist_algorithms.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/algo_type.hpp +4 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/any_node_and_algorithms.hpp +58 -45
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/avltree_node.hpp +27 -26
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/bstree_algorithms_base.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/common_slist_algorithms.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/config_begin.hpp +8 -3
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/default_header_holder.hpp +4 -3
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/ebo_functor_holder.hpp +27 -26
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/equal_to_value.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/exception_disposer.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/generic_hook.hpp +9 -7
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/has_member_function_callable_with.hpp +83 -57
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/hashtable_node.hpp +30 -30
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/hook_traits.hpp +9 -8
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/iiterator.hpp +8 -7
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/iterator.hpp +16 -15
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/key_nodeptr_comp.hpp +70 -44
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/list_iterator.hpp +22 -21
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/list_node.hpp +7 -6
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/parent_from_member.hpp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/rbtree_node.hpp +29 -28
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/reverse_iterator.hpp +33 -12
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/size_holder.hpp +19 -12
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/slist_iterator.hpp +21 -20
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/slist_node.hpp +4 -3
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/to_raw_pointer.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/transform_iterator.hpp +23 -22
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/tree_iterator.hpp +23 -22
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/tree_node.hpp +10 -9
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/tree_value_compare.hpp +103 -29
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/workaround.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/hashtable.hpp +295 -211
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/linear_slist_algorithms.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/list.hpp +20 -7
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/list_hook.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/member_value_traits.hpp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/options.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/parent_from_member.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/pointer_plus_bits.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/pointer_traits.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/priority_compare.hpp +22 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/rbtree.hpp +36 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/rbtree_algorithms.hpp +43 -13
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/set.hpp +95 -8
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/set_hook.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/sg_set.hpp +96 -12
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/sgtree.hpp +102 -5
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/sgtree_algorithms.hpp +48 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/slist.hpp +20 -11
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/slist_hook.hpp +9 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/splay_set.hpp +95 -8
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/splaytree.hpp +36 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/splaytree_algorithms.hpp +27 -0
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/treap.hpp +167 -23
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/treap_algorithms.hpp +28 -0
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/treap_set.hpp +100 -46
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/trivial_value_traits.hpp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/unordered_set.hpp +37 -27
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/unordered_set_hook.hpp +30 -14
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +35 -36
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_numeric.hpp +6 -28
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/try_lexical_convert.hpp +20 -5
- data/src/cxx_supportlib/vendor-modified/boost/libs/regex/src/posix_api.cpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/libs/regex/src/regex.cpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/pthread/once.cpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/pthread/thread.cpp +11 -7
- data/src/cxx_supportlib/vendor-modified/boost/math/policies/policy.hpp +1 -3
- data/src/cxx_supportlib/vendor-modified/boost/math/special_functions/fpclassify.hpp +5 -1
- data/src/cxx_supportlib/vendor-modified/boost/math/special_functions/math_fwd.hpp +11 -0
- data/src/cxx_supportlib/vendor-modified/boost/math/tools/config.hpp +10 -2
- data/src/cxx_supportlib/vendor-modified/boost/move/adl_move_swap.hpp +40 -7
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/adaptive_merge.hpp +67 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/adaptive_sort.hpp +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/adaptive_sort_merge.hpp +2437 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/basic_op.hpp +121 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/insertion_sort.hpp +127 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/merge.hpp +637 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/merge_sort.hpp +139 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/move.hpp +155 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algorithm.hpp +1 -116
- data/src/cxx_supportlib/vendor-modified/boost/move/core.hpp +14 -13
- data/src/cxx_supportlib/vendor-modified/boost/move/default_delete.hpp +17 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/config_begin.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/destruct_n.hpp +67 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/fwd_macros.hpp +227 -32
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/iterator_traits.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/meta_utils.hpp +30 -9
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/meta_utils_core.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/move_helpers.hpp +84 -80
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/placement_new.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/reverse_iterator.hpp +171 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +14 -20
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/unique_ptr_meta_utils.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/workaround.hpp +14 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/iterator.hpp +32 -33
- data/src/cxx_supportlib/vendor-modified/boost/move/make_unique.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/unique_ptr.hpp +49 -49
- data/src/cxx_supportlib/vendor-modified/boost/move/utility.hpp +8 -7
- data/src/cxx_supportlib/vendor-modified/boost/move/utility_core.hpp +17 -16
- data/src/cxx_supportlib/vendor-modified/boost/mpl/print.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/none.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/none_t.hpp +2 -3
- data/src/cxx_supportlib/vendor-modified/boost/operators.hpp +197 -255
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/old_optional_implementation.hpp +1059 -0
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_aligned_storage.hpp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_config.hpp +116 -0
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_factory_support.hpp +36 -0
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_reference_spec.hpp +253 -0
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_relops.hpp +196 -0
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_swap.hpp +117 -0
- data/src/cxx_supportlib/vendor-modified/boost/optional/optional.hpp +372 -554
- data/src/cxx_supportlib/vendor-modified/boost/optional/optional_fwd.hpp +12 -1
- data/src/cxx_supportlib/vendor-modified/boost/pool/detail/mutex.hpp +15 -7
- data/src/cxx_supportlib/vendor-modified/boost/pool/pool_alloc.hpp +24 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/compiler/intel.h +9 -2
- data/src/cxx_supportlib/vendor-modified/boost/predef/compiler/visualc.h +15 -1
- data/src/cxx_supportlib/vendor-modified/boost/predef/hardware/simd.h +16 -4
- data/src/cxx_supportlib/vendor-modified/boost/predef/hardware/simd/x86.h +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/predef/hardware/simd/x86_amd.h +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/predef/hardware/simd/x86_amd/versions.h +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/predef/os/cygwin.h +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/predef/version.h +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/predef/version_number.h +20 -1
- data/src/cxx_supportlib/vendor-modified/boost/preprocessor/cat.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/preprocessor/config/config.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/preprocessor/seq/detail/binary_transform.hpp +5 -6
- data/src/cxx_supportlib/vendor-modified/boost/preprocessor/seq/detail/to_list_msvc.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/preprocessor/seq/to_list.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/range/const_iterator.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/range/size_type.hpp +0 -5
- data/src/cxx_supportlib/vendor-modified/boost/regex/concepts.hpp +16 -16
- data/src/cxx_supportlib/vendor-modified/boost/regex/config.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/regex/pending/unicode_iterator.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/basic_regex_creator.hpp +102 -87
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/basic_regex_parser.hpp +45 -21
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/cpp_regex_traits.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/fileiter.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/instances.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/match_flags.hpp +14 -2
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/mem_block_cache.hpp +46 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher.hpp +5 -2
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher_common.hpp +5 -14
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher_non_recursive.hpp +116 -13
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher_recursive.hpp +34 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_format.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_traits.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_traits_defaults.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_workaround.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/w32_regex_traits.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/allocate_shared_array.hpp +1004 -159
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/bad_weak_ptr.hpp +9 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/atomic_count.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/shared_count.hpp +4 -58
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base.hpp +5 -2
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_clang.hpp +9 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_impl.hpp +0 -8
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_has_sync.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_noexcept.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/spinlock.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/enable_shared_from_this.hpp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/intrusive_ptr.hpp +28 -3
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/intrusive_ref_counter.hpp +187 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_array.hpp +52 -144
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_object.hpp +120 -450
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/scoped_array.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/scoped_ptr.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/shared_array.hpp +7 -6
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/shared_ptr.hpp +70 -8
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/weak_ptr.hpp +6 -5
- data/src/cxx_supportlib/vendor-modified/boost/system/error_code.hpp +9 -8
- data/src/cxx_supportlib/vendor-modified/boost/system/system_error.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/thread/barrier.hpp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/thread/completion_latch.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/queue_views.hpp +0 -11
- data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/sync_timed_queue.hpp +6 -4
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/config.hpp +11 -2
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/thread.hpp +11 -4
- data/src/cxx_supportlib/vendor-modified/boost/thread/exceptions.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/thread/executors/executor.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/thread/executors/generic_executor_ref.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/thread/executors/loop_executor.hpp +22 -18
- data/src/cxx_supportlib/vendor-modified/boost/thread/future.hpp +163 -55
- data/src/cxx_supportlib/vendor-modified/boost/thread/futures/launch.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/futures/wait_for_all.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/thread/lock_types.hpp +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/thread/locks.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/condition_variable.hpp +6 -7
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/condition_variable_fwd.hpp +17 -2
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/shared_mutex.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/thread_data.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/timespec.hpp +29 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/scoped_thread.hpp +23 -18
- data/src/cxx_supportlib/vendor-modified/boost/thread/synchronized_value.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/thread/thread_functors.hpp +19 -4
- data/src/cxx_supportlib/vendor-modified/boost/thread/thread_guard.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/thread/user_scheduler.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_index.hpp +265 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_index/stl_type_index.hpp +272 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_index/type_index_facade.hpp +300 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/add_reference.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/aligned_storage.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/common_type.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/common_arithmetic_type.hpp +9 -3
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/mp_defer.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/extent.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_nothrow_assign.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_nothrow_constructor.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_nothrow_destructor.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_trivial_assign.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_trivial_copy.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_trivial_destructor.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_trivial_move_assign.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_trivial_move_constructor.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_abstract.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_array.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_assignable.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_const.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_default_constructible.hpp +21 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_destructible.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_nothrow_move_assignable.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_nothrow_move_constructible.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_pod.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_rvalue_reference.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_virtual_base_of.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_volatile.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/make_void.hpp +52 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/rank.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_all_extents.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_const.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_cv.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_extent.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_pointer.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_volatile.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/type_with_alignment.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/fwd.hpp +40 -6
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/implementation.hpp +4986 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/map.hpp +107 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/set.hpp +105 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map.hpp +1814 -1255
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map_fwd.hpp +41 -45
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set.hpp +1498 -1161
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set_fwd.hpp +40 -44
- data/src/cxx_supportlib/vendor-modified/boost/utility.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/utility/base_from_member.hpp +7 -6
- data/src/cxx_supportlib/vendor-modified/boost/utility/compare_pointees.hpp +10 -2
- data/src/cxx_supportlib/vendor-modified/boost/utility/string_ref.hpp +39 -22
- data/src/cxx_supportlib/vendor-modified/boost/utility/string_view.hpp +690 -0
- data/src/cxx_supportlib/vendor-modified/boost/utility/string_view_fwd.hpp +39 -0
- data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
- data/src/helper-scripts/crash-watch.rb +3 -0
- data/src/ruby_supportlib/phusion_passenger.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +1 -0
- data/src/ruby_supportlib/phusion_passenger/packaging.rb +2 -12
- metadata +77 -38
- data/dev/ci/inituidgid +0 -24
- data/dev/ci/run_jenkins.sh +0 -70
- data/dev/ci/run_travis.sh +0 -314
- data/doc/Design and Architecture.html +0 -2421
- data/doc/Design and Architecture.txt +0 -511
- data/doc/Security of user switching support.html +0 -1833
- data/doc/Users guide Apache.html +0 -3101
- data/doc/Users guide Apache.idmap.txt +0 -451
- data/doc/Users guide Apache.txt +0 -534
- data/doc/Users guide Nginx.html +0 -3026
- data/doc/Users guide Nginx.idmap.txt +0 -431
- data/doc/Users guide Nginx.txt +0 -451
- data/doc/Users guide Standalone.html +0 -2092
- data/doc/Users guide Standalone.idmap.txt +0 -137
- data/doc/Users guide Standalone.txt +0 -81
- data/doc/Users guide.html +0 -1606
- data/doc/Users guide.txt +0 -8
- data/src/cxx_supportlib/vendor-modified/boost/align/align.hpp +0 -20
- data/src/cxx_supportlib/vendor-modified/boost/align/detail/address.hpp +0 -29
- data/src/cxx_supportlib/vendor-modified/boost/align/detail/align.hpp +0 -40
- data/src/cxx_supportlib/vendor-modified/boost/align/detail/align_cxx11.hpp +0 -22
- data/src/cxx_supportlib/vendor-modified/boost/align/detail/is_alignment.hpp +0 -29
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/hash_table.hpp +0 -383
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/array_allocator.hpp +0 -318
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/array_count_impl.hpp +0 -67
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/array_traits.hpp +0 -60
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/array_utility.hpp +0 -214
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_if_array.hpp +0 -34
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/allocate.hpp +0 -1128
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/buckets.hpp +0 -928
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/equivalent.hpp +0 -686
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/extract_key.hpp +0 -188
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/table.hpp +0 -873
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/unique.hpp +0 -628
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/util.hpp +0 -266
@@ -1,511 +0,0 @@
|
|
1
|
-
= Phusion Passenger Design and Architecture =
|
2
|
-
|
3
|
-
image:images/phusion_banner.png[link="http://www.phusion.nl/"]
|
4
|
-
|
5
|
-
This guide describes link:https://www.phusionpassenger.com/[Phusion Passenger]'s design and architecture in detail. With this guide, we hope that contributors can quickly find their way around the Phusion Passenger codebase.
|
6
|
-
|
7
|
-
The guide assumes that you're familiar with using Phusion Passenger and with Nginx or Apache, and that you've read the link:https://github.com/phusion/passenger/blob/master/CONTRIBUTING.md[Contributors Guide] and the link:https://github.com/phusion/passenger/blob/master/doc/DeveloperQuickstart.md[Developer QuickStart].
|
8
|
-
|
9
|
-
image:images/code_walkthrough.jpg[link="http://vimeo.com/phusionnl/review/98027409/03ba678684"] +
|
10
|
-
'You should also watch the complementary video: link:http://vimeo.com/phusionnl/review/98027409/03ba678684[Phusion Passenger Code Walkthrough]'
|
11
|
-
|
12
|
-
== Introduction
|
13
|
-
|
14
|
-
[[web_app_models]]
|
15
|
-
=== Web application models and the role of the application server
|
16
|
-
|
17
|
-
Before we describe Phusion Passenger, it is important to understand how typical web applications work from the viewpoint of someone who wants to connect a web application to a web server.
|
18
|
-
|
19
|
-
A typical, isolated, web application accepts an HTTP request from some I/O channel, processes it internally, and outputs an HTTP response, which is sent back to the client. This is done in a loop, until the application is commanded to exit. This does not necessarily mean that the web application speaks HTTP directly: it just means that the web application accepts some kind of representation of an HTTP request.
|
20
|
-
|
21
|
-
image:images/typical_isolated_web_application.png[Architecture of a typical web application in isolation]
|
22
|
-
|
23
|
-
Some web applications are directly accessible through the HTTP protocol, while others are not. It depends on the language and framework that the web application is built on. For example, Ruby (Rack/Rails) and Python (WSGI) web applications are typically not directly accessible through the HTTP protocol. On the other hand, Node.js web applications *do* tend to be accessible through the HTTP protocol. The reasons for this are historical, but they're outside the scope of this guide.
|
24
|
-
|
25
|
-
==== Common models
|
26
|
-
|
27
|
-
Here are some common models that are in use:
|
28
|
-
|
29
|
-
1. The web application is contained in an application server. This application server may or may not be able to contain multiple web applications. The administrator then connects the application server to a web server through some kind of protocol. This protocol may be HTTP, FastCGI, SCGI, AJP or whatever. The web server dispatches (forwards) requests to the application server, which in turn dispatches requests to the correct web application, in a format that the web application understands. Conversely, HTTP responses outputted by the web application are sent to the application server, which in turn sends them to the web server, and eventually to the HTTP client.
|
30
|
-
+
|
31
|
-
Typical examples of such a model:
|
32
|
-
+
|
33
|
-
* A J2EE application, contained in the Tomcat application server, reverse proxied behind the Apache web server. Tomcat can contain multiple web applications in a single Tomcat instance.
|
34
|
-
* Most Ruby application servers besides Phusion Passenger (Thin, Unicorn, Goliath, etc). These application servers can only contain a single Ruby web application per instance. They load the web application into their own process and are put behind a web server (Apache, Nginx) in a reverse proxy setup.
|
35
|
-
* Green Unicorn, the Python (WSGI) application server, behind a reverse proxy setup.
|
36
|
-
* PHP web applications spawned by the FastCGI Process Manager (FPM), behind an Nginx reverse proxy setup.
|
37
|
-
|
38
|
-
2. The web application is contained directly in a web server. In this case, the web server acts like an application server. Typical examples include:
|
39
|
-
+
|
40
|
-
--
|
41
|
-
* PHP web applications running on Apache through mod_php.
|
42
|
-
* Python (WSGI) web applications running on Apache through mod_uwsgi or mod_python.
|
43
|
-
--
|
44
|
-
+
|
45
|
-
Note that this does not necessarily mean that the web application is run inside the same process as the web server: it just means that the web server manages applications. In case of mod_php, PHP runs directly inside the Apache worker processes, but in case of mod_uwsgi the Python processes can be configured to run out-of-process.
|
46
|
-
+
|
47
|
-
Phusion Passenger for Apache and Phusion Passenger for Nginx implement this model, and run applications outside the web server process.
|
48
|
-
|
49
|
-
3. The web application *is* a web server, and can accept HTTP requests directly. Examples of this model:
|
50
|
-
+
|
51
|
-
--
|
52
|
-
* Almost all Node.js and Meteor JS web applications.
|
53
|
-
* The Trac bug tracking software, running in its standalone server.
|
54
|
-
--
|
55
|
-
+
|
56
|
-
In most setups, the administrator puts them in a reverse proxy configuration, behind a real web server such as Apache or Nginx, instead of letting them accept HTTP requests directly.
|
57
|
-
+
|
58
|
-
Phusion Passenger Standalone implements this model. However, you can expose Phusion Passenger Standalone directly to the Internet because it uses Nginx internally.
|
59
|
-
|
60
|
-
4. The web application does not speak HTTP directly, but is connected directly to the web server through some communication adapter. CGI, FastCGI and SCGI are good examples of this.
|
61
|
-
|
62
|
-
The above models cover how nearly all web applications work, whether they're based on PHP, Django, J2EE, ASP.NET, Ruby on Rails, or whatever. Note that all of these models provide the same functionality, i.e. no model can do something that a different model can't. The critical reader will notice that all of these models are identical to the one described in the first diagram, if the combination of web servers, application servers, web applications etc. are considered to be a single entity; a black box if you will.
|
63
|
-
|
64
|
-
It should also be noted that these models do not enforce any particular I/O processing implementation. The web servers, application servers, web applications, etc. could process I/O serially (i.e. one request at a time),
|
65
|
-
could multiplex I/O with a single thread (e.g. by using `select(2)` or `poll(2)`) or it could process I/O with multiple threads and/or multiple processes. It depends on the implementation.
|
66
|
-
|
67
|
-
Of course, there are many variations possible. For example, load balancers could be used. But that is outside the scope of this document.
|
68
|
-
|
69
|
-
==== The rationale behind reverse proxying
|
70
|
-
|
71
|
-
As you've seen, administrators often put the web application or its application server behind a real web server in a reverse proxy setup, even when the web app/app server already speaks HTTP. This is because implementing HTTP in a proper, secure way involves more than just speaking the protocol. The public Internet is a hostile environment where clients can send any arbitrary data and can exhibit any arbitrary I/O patterns. If you don't properly implement I/O handling, then you could open yourself either to parser vulnerabilities, or denial-of-service attacks.
|
72
|
-
|
73
|
-
Web servers like Apache and Nginx have already implemented world-class I/O and connection handling code and it would be a waste to reinvent their wheel. In the end, putting the application in a reverse proxying setup often makes the whole system more robust and and more secure. This is the reason why it's considered good practice.
|
74
|
-
|
75
|
-
A typical problem involves dealing with *slow clients*. These clients may send HTTP requests slowly and read HTTP responses slowly, perhaps taking many seconds to complete their work. A naive single-threaded HTTP server implementation that reads an HTTP requests, processes, and sends the HTTP response in a loop may end up spending so much time waiting for I/O that spends very little time doing actual work. Worse: suppose that the client is malicious, just leaves the socket open and never reads the HTTP response, then the server will spend forever waiting for the client, not being able to handle any more requests. A real-world attack based on this principle is link:http://en.wikipedia.org/wiki/Slowloris[Slowloris].
|
76
|
-
|
77
|
-
.An example of a naive HTTP server implementation
|
78
|
-
-------------------
|
79
|
-
while true
|
80
|
-
client = accept_next_client()
|
81
|
-
request = read_http_request(client)
|
82
|
-
response = process_request(request)
|
83
|
-
send_http_response(client, response)
|
84
|
-
end
|
85
|
-
-------------------
|
86
|
-
|
87
|
-
There are many ways to solve this problem. One could use one thread per client, one could implement I/O timeouts, one could use an evented I/O architecture, one could have a dedicated I/O thread or process buffer requests and responses. The point is, implementing all this properly is non-trivial. Instead of reimplementing these over and over in each application server, it's better to let a real web server deal with all the details and let the application server and the web application do what they're best at: their own core business logic.
|
88
|
-
|
89
|
-
=== Phusion Passenger architecture overview
|
90
|
-
|
91
|
-
image:images/passenger_architecture_overview.png[An overview of Phusion Passenger's architecture]
|
92
|
-
|
93
|
-
Phusion Passenger is not a single, monolithic entity. Instead, it consists of multiple components and processes that work together. Part of the reason why Phusion Passenger is split like this, is because it's technically necessary (no other way to implement it). But another part of the reason is stability and robustness. Individual components can crash and can be restarted independently from each other. If we were to put everything inside a single process, then a crash will take down all of Phusion Passenger.
|
94
|
-
|
95
|
-
Thus, if the Passenger core crashes, or if an application process crashes, they can both be restarted without affecting the web server's stability.
|
96
|
-
|
97
|
-
==== Web server module
|
98
|
-
|
99
|
-
When an HTTP client sends a request, it is received by the web server (Nginx or Apache). Both Apache and Nginx can be extended with **modules**. Phusion Passenger provides such a module. The module is loaded into Nginx/Apache. It checks whether the request should be handled by a Phusion Passenger-served web application, and if so, forwards the request to the Passenger core. The internal wire protocol used during this forwarding, is a modified version of link:http://en.wikipedia.org/wiki/SCGI[SCGI].
|
100
|
-
|
101
|
-
The Nginx module and Apache module have an entirely different code base. Their code bases are in `src/nginx_module` and `src/apache2_module`, respectively. Both modules are relatively small because they outsource most logic to the Passenger core, and because they utilize a common library (`src/cxx_supportlib`). This allows us to support both Nginx and Apache without having to write a lot of things twice.
|
102
|
-
|
103
|
-
==== Passenger core
|
104
|
-
|
105
|
-
The **Passenger core** is where most of the processing is done. The core keeps track of which application processes currently exist, and using load balancing rules, determines which process a request should be forwarded to. The core also takes care of **application spawning**: if it determines that having more application processes is necessary or beneficial, then it will make that happen. Process spawning is subject to user-configured limits: the core will never spawn more processes than a user-configured maximum.
|
106
|
-
|
107
|
-
The core also has monitoring and statistics gathering capabilities. It constantly keeps track of applications' memory usage, how many requests they've handled, etc. This information can later be queried from administration tools. And if an application process crashes, the core restarts it.
|
108
|
-
|
109
|
-
The core is by far the largest and most complex part of the system, but it is itself composed of several smaller subsystems. Most of the <<passenger_core_architecture,core architecture>> chapter is devoted to describing the core.
|
110
|
-
|
111
|
-
==== UstRouter
|
112
|
-
|
113
|
-
The core cooperates with the **UstRouter**. This latter is responsible for sending data to link:https://www.unionstationapp.com[Union Station], a monitoring web service. If you didn't explicitly tell Phusion Passenger to send data to Union Station, then the UstRouter sits idle and does not consume resources.
|
114
|
-
|
115
|
-
==== Watchdog
|
116
|
-
|
117
|
-
The core and the UstRouter contain complex logic, so they could contain bugs which could crash them.
|
118
|
-
So as a safety measure, they are both monitored by the **Watchdog**. If either of them crash, they are restarted by the Watchdog. This setup seeks to ensure that the system stays up, no matter what.
|
119
|
-
|
120
|
-
You might now wonder: what happens if the Watchdog crashes? Shouldn't the Watchdog be monitored by another Watchdog? We've contemplated this possibility, but the Watchdog is very simple, and since 2012 we haven't seen a single report of the Watchdog crashing, nor have we been able to make it crash since that time. So, for the sake of keeping the codebase as simple as possible, we've chosen not to introduce multiple Watchdogs.
|
121
|
-
|
122
|
-
==== Command line tools
|
123
|
-
|
124
|
-
Finally, there is an array of **command line tools** which support Phusion Passenger. The installers -- `passenger-install-*-module` -- are responsible for installing Phusion Passenger. There are administrative tools such as `passenger-status` and `passenger-memory-stats`. And many more. Some of these tools may communicate with one of the agents. For example, the `passenger-status` queries the core for information that the core has collected. How this communication is done, is described in <<instance_state_and_communication,Instance state and communication>>.
|
125
|
-
|
126
|
-
==== Passenger Standalone
|
127
|
-
|
128
|
-
You might have noticed that Phusion Passenger Standalone is not part of the diagram. So how does it fit into the architecture? Well, Phusion Passenger Standalone is actually just Phusion Passenger for Nginx. The `passenger start` command simply sets up a modified and stripped-down Nginx web server (which we call the `WebHelper`) with the Phusion Passenger Nginx module loaded.
|
129
|
-
|
130
|
-
=== Build system and source tree
|
131
|
-
|
132
|
-
Phusion Passenger is written mostly in C\++ and Ruby. The web server modules, core, UstRouter and Watchdog are written in C++. Most command line tools are written in Ruby. You can find each component here:
|
133
|
-
|
134
|
-
* The web server modules can be found in `src/apache2_module` and `src/nginx_module`.
|
135
|
-
* The Passenger core, UstRouter and Watchdog can be found in `src/agent`.
|
136
|
-
* The command line tools can be found in `bin`, with some parts of their code in `lib`.
|
137
|
-
|
138
|
-
More information can be found in the link:https://github.com/phusion/passenger/blob/master/CONTRIBUTING.md[Contributors Guide]. This guide also teaches you how to compile Phusion Passenger.
|
139
|
-
|
140
|
-
|
141
|
-
== Initialization
|
142
|
-
|
143
|
-
image:images/startup_sequence.png[Startup sequence]
|
144
|
-
|
145
|
-
Phusion Passenger initializes as follows.
|
146
|
-
|
147
|
-
1. First, the user begins with starting the web server. This for example be done by running `sudo service apache2 start` or `sudo service nginx start`. Or perhaps the web server is configured to be automatically started by the OS, in which case the user doesn't have to do anything. In case of Phusion Passenger Standalone, the user runs `passenger start` which in turn starts Nginx.
|
148
|
-
|
149
|
-
2. The Phusion Passenger module inside Nginx/Apache proceeds with starting the Watchdog. This is implemented in:
|
150
|
-
+
|
151
|
-
* `src/nginx_module/ngx_http_passenger_module.c`, function `start_watchdog()`.
|
152
|
-
* `src/apache2_module/Hooks.cpp`, in the constructor for the `Hooks` class.
|
153
|
-
* `src/cxx_supportlib/WatchdogLauncher.h` and `WatchdogLauncher.cpp`. Most of the logic pertaining starting the Watchdog is in this file.
|
154
|
-
|
155
|
-
3. The Watchdog first initializes a <<instance_state_and_communication,"instance directory">>, which is a temporary directory containing files that will be used during the life time of this Phusion Passenger instance. For example, the directory contains Unix domain socket files, so that the different Phusion Passenger processes can communicate with each other. The Watchdog is implemented in `src/agent/Watchdog/Main.cpp`.
|
156
|
-
|
157
|
-
4. The Watchdog starts the Passenger core and the UstRouter simultaneously. Each performs its own initialization.
|
158
|
-
|
159
|
-
5. When the core is done initializing, it will send a message back to the Watchdog saying that it's done. The UstRouter does something similar. When the Watchdog has received both acknowledgment messages, it finishes initialization. If the Watchdog notices that one of the agents have exited without sending an acknowledgment message, then it enters an error state.
|
160
|
-
|
161
|
-
6. The Watchdog reports successful startup back to the Phusion Passenger module that's running inside Nginx/Apache. Or, if initialization didn't success, the Watchdog reports back an error. The Phusion Passenger module inside Nginx/Apache then logs the error.
|
162
|
-
|
163
|
-
After initialization, Phusion Passenger is ready to receive and to process requests.
|
164
|
-
|
165
|
-
|
166
|
-
[[passenger_core_architecture]]
|
167
|
-
== Passenger core architecture
|
168
|
-
|
169
|
-
image:images/passenger_core_architecture.png[Passenger core architecture]
|
170
|
-
|
171
|
-
The Passenger core consists of two subsystems. One is the *request handling subsystem*. The other is *the ApplicationPool subsystem*, which performs the bulk of process management. The core also uses a number of support libraries. The largest third-party support libraries are shown in the diagram. Many more -- internal -- support libraries are used, but they're omitted from the diagram. You can find these internal support libraries in the directory `src/cxx_supportlib/Utils`.
|
172
|
-
|
173
|
-
=== Request handling
|
174
|
-
|
175
|
-
Recall that requests are first received from the web server. The web server serializes the request into a slightly modified version of link:http://en.wikipedia.org/wiki/SCGI[the SCGI format], and sends it to the core's RequestHandler. The RequestHandler performs some work, and eventually sends back a regular HTTP response. The web server parses the RequestHandler response, and sends a response to the original HTTP client.
|
176
|
-
|
177
|
-
The RequestHandler listens on a Unix domain socket file. This Unix domain socket file is called `request`, and is located in <<instance_state_and_communication,the instance directory>>.
|
178
|
-
|
179
|
-
==== One client per request
|
180
|
-
|
181
|
-
The web server creates a new connection to the core on every request. Thus, from the viewpoint of the RequestHandler, its client is the web server. Every time a client connects (i.e. a new request is forwarded), the RequestHandler creates a new Client object which represents that request. All request-specific state is stored inside the Client. After the RequestHandler is done processing a request, it closes the client socket.
|
182
|
-
|
183
|
-
Note that in the diagram, a Client has a 0..1 association with RequestHandler. That's because when a Client is disconnected, the pointer to the associated RequestHandler is set to NULL. There might be background operations left which still have a pointer to the Client. As soon as those background operations finish, they check whether the Client has a valid pointer to the RequestHandler. If so, they commit their work; if not, they discard their work. The Client is destroyed when all its associated background operations have finished.
|
184
|
-
|
185
|
-
[[request_handler_forwarding_to_app]]
|
186
|
-
==== Forwarding to the application
|
187
|
-
|
188
|
-
The RequestHandler asynchronously asks the ApplicationPool subsystem to select an appropriate application process to handle this request. The ApplicationPool checks whether there is an appropriate process, and if not, tries to spawn one. Maybe spawning is not possible right now because of configured resource limits, and we have to wait. In any case, the ApplicationPool takes care of all the nasty details and book keeping, and eventually replies back to the RequestHandler with either a Session object, or an exception.
|
189
|
-
|
190
|
-
A Session object represents a single request/response cycle with a particular application process. The RequestHandler uses the information in this Session object to establish a connection with that process and forwards the request, using <<loader_setting_up_server,a protocol that the application prefers>> and that the RequestHandler supports. The process performs work, and replies back with an HTTP response. The RequestHandler parses and postprocesses the response, and sends a response back to the web server.
|
191
|
-
|
192
|
-
If the ApplicationPool replied with an exception, the RequestHandler sends back an error response.
|
193
|
-
|
194
|
-
==== I/O model
|
195
|
-
|
196
|
-
The RequestHandler uses the **evented I/O model**. This means that the RequestHandler handles many clients (requests) at the same time, using a single thread, inside a single process. This is possible through the use of I/O event multiplexing mechanisms, which are provided by the OS. Examples of such mechanisms include the `select()`, `poll()`, `epoll()` and `kqueue()` system calls. But those mechanisms are very low-level and OS-specific, so the RequestHandler uses two libraries which abstract away the differences and provide a higher-level API: link:http://software.schmorp.de/pkg/libev.html[libev] and link:https://github.com/libuv/libuv[libuv].
|
197
|
-
|
198
|
-
The evented I/O model is also used in Nginx. It is in contrast to the single-threaded multi-process model which handles 1 client per process (used by Apache with the prefork MPM), or the multi-threaded model which handles 1 client per thread (used by Apache with the worker MPM). You can learn more about evented I/O and the different I/O models through these resources:
|
199
|
-
|
200
|
-
* link:http://www.slideshare.net/marc.seeger/seeger-aysnc-io[Event-Driven I/O: A hands-on introduction] -- Marc Seeger, 2010
|
201
|
-
* link:http://stackoverflow.com/questions/5807246/event-driven-io-and-blocking-vs-nonblocking[Event Driven IO And Blocking vs NonBlocking] -- Stack Overflow
|
202
|
-
* link:http://stackoverflow.com/questions/3231018/how-does-event-driven-i-o-allow-multiprocessing[How does event driven I/O allow multiprocessing?] -- Stack Overflow
|
203
|
-
* link:http://www.kegel.com/c10k.html[The C10K problem] -- an overview of the different I/O models used in different servers; Dan Kegel
|
204
|
-
|
205
|
-
=== The ApplicationPool subsystem
|
206
|
-
|
207
|
-
The ApplicationPool subsystem is responsible for:
|
208
|
-
|
209
|
-
* Keeping track of which application processes exist.
|
210
|
-
* Spawning processes.
|
211
|
-
* Routing requests to an appropriate process. This also implies that it load balances requests between processes.
|
212
|
-
* Monitoring processes (CPU usage, memory usage, etc).
|
213
|
-
* Enforcing resource limits. Ensuring that not too many processes are spawned, ensuring that processes that use too much memory are shut down, etc.
|
214
|
-
* Restarting processes on demand (e.g. when the timestamp of `restart.txt` has changed).
|
215
|
-
* Restarting processes that have crashed.
|
216
|
-
* Queuing requests and limiting concurrency. Each process tells the ApplicationPool how many concurrent requests it can handle. If more concurrent requests come in than the processes says it can handle, then the excess requests are queued within the ApplicationPool subsystem. Similarly, if requests come in while a process is being spawned, then those requests are queued until the process is done spawning.
|
217
|
-
|
218
|
-
The main interface into the subsystem is the Pool class, with its `asyncGet()` method. The RequestHandler calls something like `pool->asyncGet(options, callback)` inside its `checkoutSession()` method. `asyncGet()` replies with a Session, or an exception.
|
219
|
-
|
220
|
-
The Pool class is the core of the subsystem. It contains high-level process management logic but not low-level details, such as the details of spawning processes. The code is further divided into the following classes, each of which contain the core code managing its respective domain:
|
221
|
-
|
222
|
-
**Group**::
|
223
|
-
Represents an application. It can contain multiple processes, all belonging to the same application.
|
224
|
-
|
225
|
-
**Process**::
|
226
|
-
Represents an OS process; an instance of a certain application. A process may have multiple server sockets on which it listens for requests. The Process class contains various book keeping information, such as the number of sessions that are currently open. It also contains the communication channel with the underlying OS process. Process objects are created through <<spawner_subsystem,the ApplicationPool Spawner sub-subsystem>>.
|
227
|
-
|
228
|
-
**Socket**::
|
229
|
-
Represents a single server socket, on which a process listens for requests. Session objects are created through Socket. Socket maintains book keeping information about how many sessions are currently open for that particular socket.
|
230
|
-
|
231
|
-
**Session**::
|
232
|
-
Represents a single request/response cycle with a particular process. Upon creation and destruction, various book keeping information is updated.
|
233
|
-
|
234
|
-
**Options (not shown in diagram)**::
|
235
|
-
A configuration object for the `Pool::asyncGet()` method.
|
236
|
-
|
237
|
-
If you look at the diagram, then you see that Group and Process all have 0..1 associations with their containing classes. An object that has a NULL association with its containing object, is considered invalid and should not be used. The fact that the association can be NULL is a detail of the memory management scheme that we employ.
|
238
|
-
|
239
|
-
[[spawner_subsystem]]
|
240
|
-
=== The Spawner subsystem
|
241
|
-
|
242
|
-
The Spawner subsystem is a sub-subsystem within ApplicationPool. It is responsible for actually spawning application processes, and then creating Process objects with the correct information in it.
|
243
|
-
|
244
|
-
The `Spawner` interface encapsulates all low-level process spawning logic. Pool calls Spawner whenever it needs to spawn another application process.
|
245
|
-
|
246
|
-
Recall that Phusion Passenger supports multiple spawn methods. For example, the `smart` spawn method spawns processes through an intermediate preloader process, and can utilize copy-on-write. This is explained in detail in link:https://www.phusionpassenger.com/library/indepth/spawn_methods/[Spawn methods explained] in the Phusion Passenger manual. Each spawn method corresponds to a different implementation of the Spawner interface. The following implementations are available:
|
247
|
-
|
248
|
-
* DirectSpawner -- implements the `direct` spawn method.
|
249
|
-
* SmartSpawner -- implements the `smart` spawn method.
|
250
|
-
* DummySpawner (not shown in diagram) -- only used in unit tests.
|
251
|
-
|
252
|
-
The spawn method is user-configurable through the `spawnMethod` field in the `Options` object. To avoid convoluting the Pool code with spawner implementation selection logic, we also have a SpawnerFactory class, which the Pool uses.
|
253
|
-
|
254
|
-
The details of the spawning process is described in <<app_spawning_and_loading,Application spawning and loading>>.
|
255
|
-
|
256
|
-
|
257
|
-
[[app_spawning_and_loading]]
|
258
|
-
== Application spawning and loading
|
259
|
-
|
260
|
-
Application processes are spawned from the Passenger core process. Spawning a process involves a lot of **preparation work**, such as setting up communication channels, setting up the current working directory, environment variables, etc. This preparation work is done by <<spawner_subsystem,a Spawner object>>, together with various support executables.
|
261
|
-
|
262
|
-
When preparation is done, your application's entry point has to be loaded somehow. That loading is done through a language-specific **loader program**. The loader program communicates with the Spawner through the communication channel that was set up earlier, initializes the language-specific environment, sets up a server, and reports back to the Spawner. This communication is done through a certain **protocol**.
|
263
|
-
|
264
|
-
=== Preparation work
|
265
|
-
|
266
|
-
image:images/spawning_preparation_work.png[Spawning preparation work]
|
267
|
-
|
268
|
-
[[basic_setup_and_forking]]
|
269
|
-
==== Basic setup and forking
|
270
|
-
|
271
|
-
Spawning begins when the `spawn()` method is called on a <<spawner_subsystem,Spawner object>>. The Spawner determines link:https://www.phusionpassenger.com/library/deploy/nginx/user_sandboxing.html[which user the process should run as], and sets up some communication channels (anonymous Unix domain socket pairs), and forks a process. The parent waits until the child exits, or replies with something over the communication channel.
|
272
|
-
|
273
|
-
The communication channel in question is -- from the viewpoint of the (pre)loader -- actually just stdin, stdout and stderr! The anonymous Unix domain socket pairs that the Spawner creates, is mapped to the child process's stdin, stdout and stderr file descriptors. Thus, Spawner sends data to the (pre)loader by writing stuff to its stdin, and the (pre)loader sends data back to the Spawner by writing stuff to stdout or stderr.
|
274
|
-
|
275
|
-
==== Loading SpawnPreparer, possibly through bash
|
276
|
-
|
277
|
-
Because the Passenger core is heavily multi-threaded, the child process has been forked by the Spawner link:http://pubs.opengroup.org/onlinepubs/009695399/functions/fork.html[may only perform async-signal-safe operations]:
|
278
|
-
|
279
|
-
[quote, The Open Group's POSIX specification, fork() man page]
|
280
|
-
"A process shall be created with a single thread. If a multi-threaded process calls fork(), the new process shall contain a replica of the calling thread and its entire address space, possibly including the states of mutexes and other resources. Consequently, to avoid errors, the child process may only execute async-signal-safe operations until such time as one of the exec functions is called. Fork handlers may be established by means of the pthread_atfork() function in order to maintain application invariants across fork() calls."
|
281
|
-
|
282
|
-
Don't worry if you don't know what this means. The point is, there's almost nothing the forked process can safely do at that stage. So it outsources most of the remaining preparation work to an external executable, the SpawnPreparer. The SpawnPreparer starts with a clean environment where it can safely execute code.
|
283
|
-
|
284
|
-
To execute the SpawnPreparer, the child process executes one of the following commands:
|
285
|
-
|
286
|
-
* If the target user's shell is bash, and the `passenger_load_shell_envvars` option is turned on:
|
287
|
-
+
|
288
|
-
`bash -l -c '/path-to/SpawnPreparer /path-to-loader-or-preloader'`
|
289
|
-
+
|
290
|
-
This causes bash to load its startup files, e.g. bashrc, profile, etc, after which it executes the SpawnPreparer with the given parameters. The reason why we do this is because a lot of users try to set environment variables in their bashrc, and they expect these environment variables to be picked up by applications spawned by Phusion Passenger. Unfortunately environment variables link:https://www.phusionpassenger.com/library/indepth/environment_variables.html[don't work that way], but we support it anyway because it is good for usability.
|
291
|
-
|
292
|
-
* Otherwise, the SpawnPreparer is executed directly, without bash:
|
293
|
-
+
|
294
|
-
`/path-to/SpawnPreparer /path-to-loader-or-preloader`
|
295
|
-
|
296
|
-
How `path-to-loader-or-preloader` is determined, is described in <<app_types_registry,The AppTypes registry>>.
|
297
|
-
|
298
|
-
==== SpawnPreparer further sets up the environment
|
299
|
-
|
300
|
-
The SpawnPreparer is responsible for setting up certain environment variables, current working directory, and other process environmental conditions. When SpawnPreparer is done, it executes the loader or the preloader.
|
301
|
-
|
302
|
-
==== Executing the loader or preloader
|
303
|
-
|
304
|
-
If `passenger_spawn_method` is set to `smart` (the default), and there is a preloader available for the application's programming language, then this step executes the language-specific **preloader**. If either of the previous conditions are not met (and thus the `passenger_spawn_method` is automatically forced to `direct`), then this step executes the language-specific **loader**.
|
305
|
-
|
306
|
-
All (pre)loaders are located in the `helper-scripts` directory in the source tree. Here are some of the (pre)loaders that are used:
|
307
|
-
|
308
|
-
[options="header"]
|
309
|
-
|================================================================================
|
310
|
-
| Language/Framework | Loader | Preloader
|
311
|
-
| Ruby Rack and Rails | rack-loader.rb | rack-preloader.rb
|
312
|
-
| Python | wsgi-loader.py | -
|
313
|
-
| Node.js and bundled Meteor | node-loader.js | -
|
314
|
-
| Unbundled Meteor | meteor-loader.rb | -
|
315
|
-
|================================================================================
|
316
|
-
|
317
|
-
<<app_types_registry,The AppTypes registry>> keeps a list of available (pre)loaders, and which languages they belong to.
|
318
|
-
|
319
|
-
What the loader does is described in <<loaders,Loaders>>. Likewise, preloaders are described in <<preloaders,Preloaders>>.
|
320
|
-
|
321
|
-
[[loaders]]
|
322
|
-
=== Loaders
|
323
|
-
|
324
|
-
A loader initializes in 4 stages:
|
325
|
-
|
326
|
-
1. It first goes through a <<loader_handshake,handshake>>, where it reads the parameters that the Spawner has sent over the communication channel.
|
327
|
-
2. It <<application_loading,loads the application>>. The behavior of this stage may be customized by the received parameters.
|
328
|
-
3. It <<loader_setting_up_server,sets up a server>>, on which this application process listens for requests.
|
329
|
-
4. It <<loader_report_readiness,sends a response back>> to the Spawner, in which it tells Spawner whether initialization was successful, and if so, where the socket is on which this application process listens for requests.
|
330
|
-
|
331
|
-
Once initialized, the loader enters a main loop, in which it keeps handling requests until a signal has been received that says it should terminate.
|
332
|
-
|
333
|
-
As explained in <<basic_setup_and_forking,Basic setup and forking>>, the communication channels that the loader uses are just plain old stdin and stdout. Every programming language supports reading and writing from these channels. This also means that you can easily test a loader by simply executing it and entering messages in the terminal.
|
334
|
-
|
335
|
-
But stdout can also be used for printing normal output. How does the Spawner distinguish between control messages, and normal messages that should be displayed? The answer is that control messages must start with `!> ` (including the trailing whitespace), and must end with a newline. The Spawner reads messages line-by-line, processes lines that start with `!> `, and prints lines that don't start with that marker.
|
336
|
-
|
337
|
-
[[loader_handshake]]
|
338
|
-
==== Handshake
|
339
|
-
|
340
|
-
The handshaking process begins with a protocol version handshake. The loader printing the line `!> I have control 1.0`. The Spawner then sends "You have control 1.0", which the loader checks. If the loader observes that the version handshake does not match the expectation, then it aborts with an error.
|
341
|
-
|
342
|
-
The Spawner also sends a list of key-value pairs, which is terminated by an empty newline. Upon receiving the empty newline, the Spawner proceeds with <<application_loading,loading the application>>.
|
343
|
-
|
344
|
-
Example:
|
345
|
-
|
346
|
-
--------------------------------------------------------
|
347
|
-
Loader Spawner
|
348
|
-
|
349
|
-
!> I have control 1.0
|
350
|
-
You have control 1.0
|
351
|
-
passenger_root: ...
|
352
|
-
passenger_version: 4.0.45
|
353
|
-
ruby_libdir: /Users/hongli/Projects/passenger/lib
|
354
|
-
generation_dir: /tmp/passenger.1.0.2082/generation-0
|
355
|
-
gupid: 1647ad4-ovJJMiPkAAt
|
356
|
-
connect_password: jXGaSzo8vRX5oGe2uuSv5tJsf1uX7ZgIeEH2x0nfOEa
|
357
|
-
app_root: /Users/hongli/Sites/rack.test
|
358
|
-
startup_file: config.ru
|
359
|
-
process_title: Passenger RackApp
|
360
|
-
log_level: 3
|
361
|
-
environment: development
|
362
|
-
base_uri: /
|
363
|
-
...
|
364
|
-
(empty newline)
|
365
|
-
--------------------------------------------------------
|
366
|
-
|
367
|
-
[[application_loading]]
|
368
|
-
==== Application loading
|
369
|
-
|
370
|
-
How the application is loaded, depends on the programming language. Here are some examples:
|
371
|
-
|
372
|
-
* The Ruby Rack loader does it by `load()`-ing the startup file, which by default is `config.ru`.
|
373
|
-
* The Python loader does it by calling `imp.load_source('passenger_wsgi', 'passenger_wsgi.py')`.
|
374
|
-
* The Node.js (and bundled Meteor) loader does it by `require()`-ing the startup file, which by default is `app.js`.
|
375
|
-
* The unbundled Meteor loader does it by executing the `meteor run` command.
|
376
|
-
|
377
|
-
If no errors occur, the loader proceeds with <<loader_setting_up_server,setting up a server>>. Otherwise, it <<loader_error_reporting,reports an error>>.
|
378
|
-
|
379
|
-
[[loader_setting_up_server]]
|
380
|
-
==== Setting up a server
|
381
|
-
|
382
|
-
The loader sets up a server on which the application listens for requests. The Spawner doesn't care how this is done, how this server works, or even what its concurrency is. It only cares about how it can contact the server. So the loader has full freedom in this step.
|
383
|
-
|
384
|
-
As explained in <<request_handler_forwarding_to_app,section 'Request handling' and subsection 'Forwarding to the application'>>, the RequestHandler can talk with the application process in a protocol that the application prefers. The RequestHandler supports two protocols:
|
385
|
-
|
386
|
-
* A Phusion Passenger internal protocol which we call the 'session' protocol. This protocol is used by the Ruby loaders and the Python loader. A description of this protocol is outside the scope of this document, but if you're interested in how it looks like and how it behaves, you can study the source code of the Ruby and Python loaders, as well as `src/cxx_supportlib/Utils/MessageIO.h`.
|
387
|
-
* The HTTP protocol. This protocol is used by the Node.js and Meteor loaders. If you're writing a new loader then, it's probably easiest to use this protocol, together with whatever HTTP library is available for the loader's target language.
|
388
|
-
|
389
|
-
Typically, the server is setup to listen on a Unix domain socket file, inside the `backends` subdirectory of the 'generation directory'. The path to the generation directory was passed during handshake. However the server may also listen on a TCP socket.
|
390
|
-
|
391
|
-
Once a server has been setup, the loader can <<load_report_readiness,report readiness>>.
|
392
|
-
|
393
|
-
[[loader_report_readiness]]
|
394
|
-
==== Reporting readiness
|
395
|
-
|
396
|
-
Once the server is set up, the loader sends back a `!> Ready` response, followed by information about where the server socket listens on, and what protocol it expects. The response is terminated with a `!> ` line (notice the trailing whitespace, which is required).
|
397
|
-
|
398
|
-
The information about where the server socket listens on, is a 4-tuple:
|
399
|
-
|
400
|
-
* The **name**. This must always be `main`.
|
401
|
-
* The **address**. For Unix domain sockets, it has the form `unix:/path-to-socket`. For TCP socket, it has the form `tcp://127.0.0.1:PORT`.
|
402
|
-
* The **protocol**. This must be either `session` or `http_session`.
|
403
|
-
* The maximum number of **concurrent connections** the server supports. The ApplicationPool will ensure that the process never receives more concurrent requests than this number. A value of 0 means that the concurrency is unlimited.
|
404
|
-
|
405
|
-
Here's an example of what the Node.js loader sends as response:
|
406
|
-
|
407
|
-
--------------------------------------------------------
|
408
|
-
!> Ready
|
409
|
-
!> socket: main;unix:/path-to-generation-dir/backends/node.1234-5677;session;0")
|
410
|
-
!>
|
411
|
-
--------------------------------------------------------
|
412
|
-
|
413
|
-
After reporting readiness, the loader can <<loader_main_loop,enter a main loop and wait for termination>>.
|
414
|
-
|
415
|
-
[[loader_error_reporting]]
|
416
|
-
==== Error reporting
|
417
|
-
|
418
|
-
If something goes wrong in any of the stages, the loader can report an error in two ways:
|
419
|
-
|
420
|
-
1. Just write the error message to stdout as you normally do, and abort without printing the `!> Ready` message. The Passenger core will read everything that the loader has written to stdout, and use it as the error message. This error message is considered to be plain text.
|
421
|
-
2. Abort after printing a special `!> Error` message. The loader can signal that the message is HTML. The RequestHandler will format the error message as HTML.
|
422
|
-
|
423
|
-
[[loader_main_loop]]
|
424
|
-
==== Main loop and termination
|
425
|
-
|
426
|
-
The loader's main loop's job is to wait until a single byte has been received on stdin. As long as the byte has not been received, the loader should not exit, and should keep processing requests. When the byte has been received, the following conditions are guaranteed to be true:
|
427
|
-
|
428
|
-
* All clients for this particular process have disconnected.
|
429
|
-
* No more clients will be routed to this particular process.
|
430
|
-
|
431
|
-
This guarantee is enforced by the RequestHandler and the ApplicationPool. Thus, the loader doesn't have to perform any kind of complicated shutdown. It can just exit the process.
|
432
|
-
|
433
|
-
If the server was listening on a Unix domain socket file, then the loader doesn't even have to remove the file. The ApplicationPool already takes care of that.
|
434
|
-
|
435
|
-
==== Stdout and stderr forwarding
|
436
|
-
|
437
|
-
All lines that the loader writes to stdout, and that are not prefixed with `!> `, are forwarded by the Passenger core to its own stdout. Similarly, everything that the loader writes to stderr, whether prefixed with `!> ` or not, is forwarded by the Passenger core to its own stdout.
|
438
|
-
|
439
|
-
While the Spawner is still doing its work, it takes care of this forwarding by itself. Once the Spawner is done, it outsources this work to two PipeWatcher objects, each which spawns a background thread for this purpose.
|
440
|
-
|
441
|
-
[[preloaders]]
|
442
|
-
=== Preloaders
|
443
|
-
|
444
|
-
Preloaders are a special kind of loaders, used for reducing spawn time and leveraging copy-on-write. You can learn more about this at link:https://www.phusionpassenger.com/library/indepth/spawn_methods/[Spawning methods explained].
|
445
|
-
|
446
|
-
Preloaders look a lot like loaders, but behave slightly differently. They also use stdin, stderr and stdout to communicate with the Spawner. The protocols are very similar.
|
447
|
-
|
448
|
-
A preloader initializes in 4 stages:
|
449
|
-
|
450
|
-
1. It first goes through a handshake, which is the same as <<loader_handshake,the loader handshake>>.
|
451
|
-
2. It <<application_loading,loads the application>> just like the loader does.
|
452
|
-
3. It sets up a server on which it listens for spawn commands.
|
453
|
-
4. It sends a response back to the Spawner. This is similar to how the loader does it, but instead of telling the Spawner where the application listens for requests, it tells the Spawner where the preloader process listens for spawn commands.
|
454
|
-
|
455
|
-
Once initialized, the preloader enters a main loop, in which it keeps handling spawn commands until a signal has been received that says it should terminate.
|
456
|
-
|
457
|
-
When a spawn command is received, the preloader forks off a child process (which already has the application loaded) and reports the child process's PID to the Spawner. It also sets up a communication channel between the Spawner and the child process.
|
458
|
-
|
459
|
-
[[app_types_registry]]
|
460
|
-
=== The AppTypes registry
|
461
|
-
|
462
|
-
When the web server receives a request, the Phusion Passenger module inside it autodetects the type of application that the request belongs to. It does that by examening the filesystem and checking which one of the startup files exist. For example, if `config.ru` exists, then it assumes that it's a Ruby app. Or if `app.js` exists, then it assumes that it's a Node.js app. The Phusion Passenger module forwards the inferred application type to the Passenger core.
|
463
|
-
|
464
|
-
Given an application type, the associated loader and preloader can be looked up.
|
465
|
-
|
466
|
-
Information about the supported application types, startup files, loaders and preloaders are defined in the following places:
|
467
|
-
|
468
|
-
* The constant `appTypeDefinitions` in the file `src/cxx_supportlib/AppTypes.cpp` keeps a list of supported languages. It also specifies the default startup file name belonging to each language.
|
469
|
-
* The method `getStartCommand()` in the file `src/agent/Core/ApplicationPool2/Options.h` defines the loaders that should be used for each language.
|
470
|
-
* The method `tryCreateSmartSpawner()` in the file `src/agent/Core/SpawningKit/Factory.h` defines the preloaders that should be used for each language.
|
471
|
-
* The method `looks_like_app_directory?` in the file `src/ruby_supportlib/phusion_passenger/standalone/app_finder.rb` keeps a list of supported startup files. This is only used within Passenger Standalone.
|
472
|
-
|
473
|
-
|
474
|
-
[[instance_state_and_communication]]
|
475
|
-
== Instance state and communication
|
476
|
-
|
477
|
-
Every time you start Phusion Passenger, you've created a new *instance*. Every instance consists of multiple processes that work together (Watchdog, Passenger core, UstRouter, application processes). All those processes have to be able to communicate with each other. Those processes must also *not* communicate with the processes belonging to other instances. For example, if you start Apache+Passenger *and* Nginx+Passenger, then we don't want the Passenger core that's started from Apache to use UstRouter that's started from Nginx.
|
478
|
-
|
479
|
-
Clearly, the processes can't listen on a specific TCP port for communication. Nor can they listen on a fixed Unix domain socket filename.
|
480
|
-
|
481
|
-
That is where the 'instance directory' comes in. Every Phusion Passenger instance has its own, unique temporary directory. That directory is removed when the instance halts. The directory contains Unix domain socket files that the processes listen on. Every Phusion Passenger related process knows where its own instance directory is, and thus, knows how to communicate with other processes belonging to the same instance. The instance directory is implemented in `src/cxx_supportlib/InstanceDirectory.h`.
|
482
|
-
|
483
|
-
Administration tools such as `passenger-status` query information using instance directories. First, they check which instance directories exist on the system. If they find only one, then they query the sockets inside that sole instance directory. Otherwise, they abort with an error and ask the user to specifically select the instance to query.
|
484
|
-
|
485
|
-
|
486
|
-
[appendix]
|
487
|
-
== About Rack
|
488
|
-
|
489
|
-
The de-facto standard interface for Ruby web applications is link:http://rack.rubyforge.org/[Rack]. Rack specifies an programming interface for web application developers to implement. This interface covers HTTP request and response handling, and is not dependent on any particular application server. The idea is that any Rack-compliant application server can implement the Rack specification and work with all Rack-compliant web applications.
|
490
|
-
|
491
|
-
image:images/rack.png[]
|
492
|
-
|
493
|
-
In the distant past, each Ruby web framework had its own interface, so application servers needed to explicitly add support for each web framework. Nowadays application servers just support Rack.
|
494
|
-
|
495
|
-
image:images/many_web_framework_protocols.png[]
|
496
|
-
|
497
|
-
Ruby on Rails has been fully Rack compliant since version 3.0. Rails 2.3 was partially Rack-compliant while earlier versions were not Rack-compliant at all. Phusion Passenger supports Rack as well as all Rails 1.x and 2.x versions.
|
498
|
-
|
499
|
-
[appendix]
|
500
|
-
== About Apache
|
501
|
-
|
502
|
-
The Apache web server has a dynamic module system and a pluggable I/O multiprocessing (the ability to handle more than 1 concurrent HTTP client at the same time) architecture. An Apache module which implements a particular multiprocessing strategy, is called a Multi-Processing Module (MPM). The single-threaded multi-process link:http://httpd.apache.org/docs/2.4/mod/prefork.html[prefork MPM] had been the default and the most popular one for a long time, but in recent times the hybrid multi-threaded/multi-process link:http://httpd.apache.org/docs/2.4/mod/worker.html[worker MPM] is becoming increasingly popular because of its better performance and scalability. Furthermore, Apache 2.4 introduced the link:http://httpd.apache.org/docs/2.4/mod/event.html[event MPM] which is a hybrid evented/multi-threaded/multi-process MPM and offers even more scalability benefits.
|
503
|
-
|
504
|
-
The prefork MPM remains in wide use today because it's the only MPM that works well with mod_php.
|
505
|
-
|
506
|
-
The prefork MPM spawns multiple worker child processes. HTTP requests are first accepted by a so-called control process, and then forwarded to one of the worker processes. The next section contains a diagram which shows the prefork MPM's architecture.
|
507
|
-
|
508
|
-
[appendix]
|
509
|
-
== About Nginx
|
510
|
-
|
511
|
-
Nginx is a lightweight web server that is becoming increasingly popular. It is known to be smaller, lighter weight and more scalable than Apache thanks to its evented I/O architecture. That said, Nginx is less flexible than Apache. For example it has no dynamic module system: all modules must be statically compiled into Nginx.
|