We keep an eye on all the issues and feature requests at the github.com/userver-framework, at the English-speaking and Russian-speaking Telegram support chats. All the good ideas are discussed, big and important ones go to the Roadmap. We also have our in-house feature requests, those could be also found in Roadmap.
Important or interesting features go to the changelog as they get implemented. Note that there's also a Security Changelog.
YDB driver now can be built on modern Clang compilers in C++20 and above modes.
Redis now allows to subscribe to master instances.
Improved logging of failures in testsuite.
Optimizations:
rcu::Variable was optimized to use asymmetric fences and concurrent::StripedCounter. x1000 performance improvement for some edge cases, x3 improvement for the generic use case.
Internal TaskCounter now uses concurrent::StripedCounter to reduce contention on atomics on each async task construction and destruction.
Adjusted the default spinning count in scheduler to better fit modern hardware and typical loads.
~5% faster tasks queue overload detection logic. Many thanks to Egor Bocharov for the PR!
Docs, tests and build
Fixed build of utils/rand.hpp related source files. Thanks to Nikita for the PR!
Improved logic of Telegram support chats URL selection. Many thanks to Mingaripov Niyaz for the PR!
Fixed multiple @snippet links in docs. Many thanks to Mingaripov Niyaz for the PR!
Fixed flaky ThreadLocal.SafeThreadLocalWorks test. Many thanks to Egor Bocharov for the PR!
April 2024
Initial CPack support. Now userver-all.deb packages could be build via:
New Docker images based on Ubuntu-22.04 with weekly builds and publishing:
ghcr.io/userver-framework/ubuntu-22.04-userver-pg:latest - image with preinstalled userver deb package and PostgreSQL database. All the service templates now use it for tests
ghcr.io/userver-framework/ubuntu-22.04-userver:latest - image with preinstalled userver deb package. Good starting container for developing servers that do not use POstgreSQL.
ghcr.io/userver-framework/ubuntu-22.04-userver-base:latest - an image with only the build dependencies to build userver. Good for development of userver itself. More info at Configure, Build and Install
All the service templates were moved to a new components naming with :: (for example userver::core) and now attempt to find an installed userver. Now in CMake component names with :: work regardless of the framework installation (CPM, add_subdirectory, or find_package).
A secret value for the digest nonce generating now could be provided in http_server_digest_auth_secret key via components::Secdist. Many thanks to Mingaripov Niyaz for the PR!
ugrpc::server::ServerComponent now has a unix-socket-path static option to listen on unix domain socket path instead of an inet socket.
All the formats::*::ValueBuilder now support std::string_view. Thanks to Андрей Будиловский for the bug report!
Redis now supports SSUBSCRIBE and removes dead nodes.
engine::WaitAny() now can wait for an engine::io::Socket/engine::io::TlsWrapper to become readable or writable. For example: engine::WaitAny(socket.GetReadableBase(), task1, tls_socket.GetWritableBase(), future1);
Switched from unmaintained http_parser to a 156% faster llhttp.
Implemented a concurrent::StripedCounter that allows to have a per-cpu data in user space with kernel-provided transactional guarantees. Works at least x2 faster than std::atomic on a single thread and scales linearly (unlike std::atomic). As a result gives more than x10 performance improvement under heavy contention.
An explicit control over cache invalidations in testsuite. As a result, less caches are invalidated between tests and the overall time to run tests goes down significantly.
Components start was optimized to copy less containers during component dependencies detection.
Per each incoming HTTP request:
one less std::chrono::steady_clock::now() call
one less StrCaseHash construction (2 calls into std::uniform_int_distribution<std::uint64_t> over std::mt19937)
HTTP Client now copies less std::shared_ptr variables in implementation.
Optimized up to an order of magnitude the user types query in PostgreSQL driver.
pytest_userver.client.Client.capture_logs() now accepts log_level to filter out messages with lower log level in the service itself and minimize CPU and memory consumption during tests.
Added missing dependency for Arch based distros. Thanks to VScdr for the PR!
February 2024
PostgreSQL driver now keeps processing the current queries and transactions after encountering a "prepared statement already exists" event.
Implemented a new landing page to make userver even more nice&shiny! The whole project was done by 👨🏻💻 frontend developer Fedor Alekseev; 🧑🏼🎨 designers hellenisaeva and MariaGrinchenko; 👨🏻💼 manager Oleg Komarov. Many thanks for the awesome work!
HTTP components::Server now has a static configuration option address to select network interface to listen to.
Flush headers before starting to produce the body parts in HTTP streaming handlers, so a client can react to the request earlier. Thanks to akhoroshev for the PR!
Added tracing::TagScope for comfortable work with local scope tracing tags. Many thanks to nfrmtk for the PR!
INCLUDE_DIRECTORIES is now used in userver_add_grpc_library. Thanks to Nikita for the PR!
New storages::postgres::QueryQueue class, mostly for executing multiple SELECT statements and retrieving the results in one roundtrip.
PostgreSQL driver now caches the low-level database (D)escribe responses, workarounds the libpq implementation and does not request query describe information on each request. This results in about ~2 times less data transmitted for select statements that return multiple columns, less CPU consumption for the database server and for the application itself.
gRPC deadline propagation now uses less now() calls and measures time more precisely.
About 16% faster HttpResponse::SetHeader due to using a vectorization friendly algorithm.
Improved Redis driver start-up time.
dynamic_config::DocsMap::Parse() and dynamic configs retrieval copies less strings.
Build:
New Docker container for developing userver based projects ghcr.io/userver-framework/ubuntu-22.04-userver-base:latest. It contains all the build dependencies preinstalled and a proper setup of PPAs with databases, compilers and tools.
Switched to a modern python venv instead of the older virtualenv.
Use system provided Boost.Stacktrace if it is available.
More references and info for the metrics documentation.
More documentation for dynamic_config::ValueDict __default__ behavior, and for dynamic configs.
January 2024
full-update-jitter default value is now full-update-interval / 10. This leads to more responsive databases on full update on multiple instances of the service.
server::handlers::ServerMonitor now has a format static config option, simplifying userver based services setup with unified agent.
Allow creating custom implicit options. Thanks to trenin17 for the PR!
Limit JSON parsing depth to some sane value. Thanks to Kirill Morozov for the PR!
Requirements are not code generated any more and the default requirements used on userver_testsuite_add_simple() CMake function call. add_grpc_library() renamed to userver_add_grpc_library().
USERVER_PIP_USE_SYSTEM_PACKAGES and USERVER_PIP_OPTIONS CMake options now allow building the userver without internet connection. Thanks to Nikita for the PR!
Curl library now downloaded automatically if no suitable version found.
Added missing check for Mongo in Conan. Thanks to Pavel Talashchenko for the PR!
Fixed sanitizers error message in CMake. Thanks to Kirill Pavlov for the PR!
Updated MacOS dependencies. Thanks to Kirill Morozov for the PRs!
Added PostgreSQL 16 detection. Thanks to linuxnyasha for the PR!
Optimizations:
Optimized Http::Cookie::ToString(). Thanks to Илья Оплачкин for the PR!
Documentation:
Documented Secdist formats and added notes on possible environment variables usage instead of secdist.
Layout of reference pages changes. Now descriptions are at the top of the page rather than being after the list of methods and members.
PostgreSQL now has the following static config options:
check-user-types option to prevent service from starting if database is not ready for work (for example: some migrations were not applied).
discard-all-on-connect - to force running DISCARD ALL on new connections, which could be useful for some PostgreSQLs smart-proxies that reuse the same connections.
Boost.PFR 2.2.0 is now in use. The door for compile time reflection pull requests is now open!
More metrics and fallbacks for logging errors.
More tests for utils::datetime::MockSteadyNow. Thanks to Aleksej Kamenev for the PR!
components::CachingComponentBase now has a static config option alert-on-failing-to-update-times to fire an alert if the cache update failed specified amount of times in a row.
Optimizations:
Caching of dl_phdr_info items is not ON by default, leading up to multiple seconds faster exception handling under heavy load when parts of the executable still being on hard drive rather than in memory. Use USERVER_DISABLE_PHDR_CACHE CMake option to disable it, if the framework reports dlopen usage after component start and there's no way to avoid it.
Optimized discarding logs by log level from 4ns to 2ns. Added CMake option USERVER_FEATURE_ERASE_LOG_WITH_LEVEL to totally eliminate all the CPU and binary size overhead from logging.
Parsing inside storages::postgres::ResultSet now does not compute parsing-failure diagnostic information if parsing is successful.
Return PostgreSQL connection to pool earlier, before updating the statistics.
fs::RewriteFileContents() now does not fsync directories, dumping caches now also do not fsync directories leading to better performance while still properly restoring after server power-off.
PostgreSQL typed parsing was optimized to not copy std::shared_ptrs.
TESTPOINT() and TESTPOINT_CALLBACK() now produce less instructions and guaranteed to not throw it the testpoints are disabled.
Samples were significantly simplified, more static configuration options now have good defaults and do not require explicit setup.
Configure, Build and Install now contains information on how to build service templates. Information on how to build the framework tests was moved to scripts/docs/en/userver/tutorial/build_userver.md
tracing::DefaultTracingManagerLocator now has incoming-format and new-requests-format static config options to configure the tracing headers to receive and send.
RabbitMQ now provides a Get() command to retrieve a single message. Thanks to Vladislav Nepogodin for the PR!
Optimizations:
Coroutines working set was reduced, leading to significantly less memory usage under most of the loads that do not use all the coroutines from pool at once.
Improved experience with metrics. Added Prometheus and Graphite metric formats. Provided a modern simple interface to write and test metrics.
Added chaos tests for drivers
Implemented streaming API for the HTTP
Improved documentation, added more samples and descriptions, improved search.
Numerous optimizations.
Numerous build improvements, including Conan and Docker support.
Optimized and improved features that were available at the Beta announcement:
gRPC client and server
Mongo driver
Redis driver
PostgreSQL
HTTP server and client
Logging and Tracing
... and many other features.
Detailed descriptions could be found below.
Beta (September 2023)
WebSockets server and TLS server are now implemented as part of the HTTP server
PostgreSQL pipelining is now implemented and turned on by default, leading to improved response times.
Mongo Congestion Control is implemented and turned on by default, leading to better stability of the service in case of high load on database.
Initial logger is now initialized from the component config, leading to a more simple code and setup. The --initial-logger option now does nothing and will be removed soon.
std::bitset<N>, std::array<bool, N>, userver::utils::Flags<Enum> and integral values are now mapped to PostgreSQL bit and bit varying types. Thanks to dsaa27 and bshirokov for the PRs!
Signifiacally optimized JSON DOM access to a non-existing element.
Logging now does not lock a mutex in fs-task-processor on each log record.
Up to 3 times faster logging due to multiple minor tweaks with data copy and memory prereserving.
The new asynchronous engine::io::sys::linux::Inotify driver for Linux allows subscriptions to filesystem events. Thanks to it the fs::FsCacheClient now reacts faster.
Non-coroutine userver-universal CMake target was refactored and is now used by the whole framework as a basic dependency. Compile times dropped down drastically for building the whole framework from scratch.
MacOS build instructions were enhanced, thanks to Daniil Shvalov for the PR!
Conan build was fixed, thanks to Yuri Bogomolov for the PR.
Numerous build and configure fixes.
Beta (June 2023)
Static configs of the service now can retrieve environment variables via the #env syntax. See yaml_config::YamlConfig for more examples.
New testsuite plugins userver_config_http_client and userver_config_testsuite_support turned on by default to increase timeouts in tests and make the functional tests more reliable.
clients::http::Request now does less atomic counters increments/decrements while the request is being built.
mlock_debug_info static configuration option of components::ManagerControllerComponent is now on by default. It improves responsiveness of the service under heavy load on low memory and bad hard drives.
engine::io::Socket now has an additional SendAll overload that accepts const struct iovec* list, std::size_t list_size for implementing low-level vector sends. Mongo driver now uses the new function, resulting in smaller CPU and memory consumption.
clients::http::Form::AddContent now instead of const std::string& parameters accepts std::string_view parameters that allow to copy less data.
TESTPOINT and other testpoint related macro now imply zero overhead if testpoints were disabled in static config.
More functions of formats::json::ValueBuilder now accept std::string_view, resulting in less std::string constructions and better performance.
TSKV escaping was optimized via SIMD, resulting in up to x10 speedup on long logs.
mlock_debug_info static configuration option of components::ManagerControllerComponent now allows to lock exception unwinding information in memory. It improves responsiveness of the service under heavy load on low memory and bad hard drives.
Experimental support for HTTP "Baggage" header is implemented, including verification, forwarding from HTTP handlers to client, baggage manipulation. See baggage::BaggageManagerComponent for more info.
Redis driver now supports non-queued variants for pubsub.
engine::Task now does not have a virtual destructor. New engine::TaskBase based hierarchy does not use RTTI, resulting in smaller binaries.
Mongo driver does not capture stack traces in release builds in case of errors. The error path become slightly faster, server is more responsive in case of Mongo problems.
Build:
Improved support for Conan 2.0, many thanks to Anton for the PR.
.gitattributes now handles line endings automatically for files detected as text. This simplifies WSL builds. Thanks to Anatoly Shirokov for the PR.
PostgreSQL libs selection is now possible in CMake if the platform has multiple versions installed, see PostgreSQL versions for more info.
Improved support for Arch Linux, many thanks to Konstantin Goncharik for the PR.
Multiple improvements for docs, including mockserver clarifications from Victor Makarov.
Beta (March 2023)
Now logging of particular lines could be controlled by dynamic config. See USERVER_LOG_DYNAMIC_DEBUG for more info.
Getting the default logger now takes only a single atomic read. LOG_* macro now do two RMW atomic operations less and do not use RCU, that could lead to a dynamic memory allocation in rare cases.
PostgreSQL driver now does much less atomic operations due to wider usage of std::move on the internal std::shared_ptr.
Now the "help wanted" issues at github have additional tags "good first issue" and "big", to help you to choose between a good starting issue and a big feature. See Releases, Trunk-based Development and Pull Requests for more info.
Cmake function userver_testsuite_add now can pass arguments to virtualenv, thanks to Дмитрий Изволов for the PR.
Improved hello_service run instruction, thanks to Svirex for the PR.
Better Python3 detection, thanks to Дмитрий Изволов for the PR.
Task processors now have an os-scheduling static config option and @md_en_userver_task_processors_guide "a usage guide".
Added a pg_service_template service template that uses userver the userver framework with PostgreSQL
In template services, it is now possible to deploy the environment and run the service in one command: make service-start-debug or make service-start-release.
Added userver::os_signals::Component, which is used for handling OS signals.