mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-14 05:04:49 +00:00
58a4f350a8
This patch refactors gun pooling to use Elixir process registry and simplifies adapter option insertion. Having the pool use process registry instead of a GenServer has a number of advantages: - Simpler code: the initial implementation adds about half the lines of code it deletes - Concurrency: unlike a GenServer, ETS-based registry can handle multiple checkout/checkin requests at the same time - Precise and easy idle connection clousure: current proposal for closing idle connections in the GenServer-based pool needs to filter through all connections once a minute and compare their last active time with closing time. With Elixir process registry this can be done by just using `Process.send_after`/`Process.cancel_timer` in the worker process. - Lower memory footprint: In my tests `gun-memory-leak` branch uses about 290mb on peak load (250 connections) and 235mb on idle (5-10 connections). Registry-based pool uses 210mb on idle and 240mb on peak load |
||
---|---|---|
.. | ||
activity | ||
bbs | ||
captcha | ||
chat | ||
config | ||
conversation | ||
docs | ||
ecto_type | ||
emails | ||
emoji | ||
gopher | ||
gun | ||
helpers | ||
http | ||
instances | ||
mfa | ||
migration_helper | ||
object | ||
plugs | ||
reverse_proxy | ||
tests | ||
upload | ||
uploaders | ||
user | ||
web | ||
workers | ||
activity.ex | ||
activity_expiration.ex | ||
application.ex | ||
application_requirements.ex | ||
bookmark.ex | ||
chat.ex | ||
clippy.ex | ||
config.ex | ||
constants.ex | ||
conversation.ex | ||
counter_cache.ex | ||
delivery.ex | ||
earmark_renderer.ex | ||
ecto_enums.ex | ||
emoji-data.txt | ||
emoji.ex | ||
filter.ex | ||
following_relationship.ex | ||
formatter.ex | ||
healthcheck.ex | ||
html.ex | ||
instances.ex | ||
job_queue_monitor.ex | ||
jwt.ex | ||
keys.ex | ||
list.ex | ||
maintenance.ex | ||
maps.ex | ||
marker.ex | ||
mfa.ex | ||
mime.ex | ||
moderation_log.ex | ||
notification.ex | ||
object.ex | ||
object_tombstone.ex | ||
otp_version.ex | ||
pagination.ex | ||
password_reset_token.ex | ||
registration.ex | ||
release_tasks.ex | ||
repo.ex | ||
repo_streamer.ex | ||
report_note.ex | ||
scheduled_activity.ex | ||
signature.ex | ||
stats.ex | ||
thread_mute.ex | ||
upload.ex | ||
user.ex | ||
user_invite_token.ex | ||
user_relationship.ex | ||
utils.ex |