Commit graph

42436 commits

Author SHA1 Message Date
Ankush Menat
b294b30301
Merge pull request #21482 from ankush/rq_worker_start
feat: RQ WorkerPool support
2023-06-26 18:53:36 +05:30
Ankush Menat
73bca16d77 feat: RQ WorkerPool
RQ now has experimental support for workerpools.

When to use this?

Roughly when you have more than 2 workers a workerpool might make
sense, below 2 it's overhead as master "pool" process will need to run
to manager workerpool itself.

Why is it any better?

Currently we just let supervisor duplicate the worker process N number
of times. This is inefficient from shared memory POV. Forking the
original process to create workers enables sharing of more memory thus
leading upwards of 60-70% reduction in memory usage with pool size of 8
workers.
2023-06-26 18:10:00 +05:30
Ankush Menat
7fbc6e8175 refactor: Simplify dequeue_strategy selection
Classes arent required anymore, it can just be a parm to worker class
isntead.
2023-06-26 17:42:18 +05:30
Ankush Menat
ca95b591ae refactor: Pass redis connection directly 2023-06-26 17:36:53 +05:30
Ankush Menat
ee74830460 chore: add github star CTA on server script sidebar
[skip ci]
2023-06-26 17:32:47 +05:30
Ankush Menat
e26152f0dc chore: use node18 for github workflow
[skip ci]
2023-06-26 13:29:18 +05:30
Ernesto Ruiz
84ac024396
chore: Add translation to text in Update kanban_settings.js (#21452)
[skip ci]
2023-06-26 10:35:49 +05:30
Ankush Menat
25c18e486c
Merge pull request #21461 from ruchamahabal/hooks
feat: before/after hooks for any app install/uninstall
2023-06-26 09:50:35 +05:30
Ankush Menat
bd7777120a
Merge pull request #21370 from surajshetty3416/update-node-dependencies
build!: Set minimum required node version as v18
2023-06-26 09:48:08 +05:30
Suraj Shetty
3667d1ae04 test: Simplify list_view test 2023-06-26 09:15:28 +05:30
Suraj Shetty
0d4574e95b fix: Use watch function to watch changes 2023-06-26 09:15:28 +05:30
Suraj Shetty
3982eeea22 chore: Fix linter warning 2023-06-26 09:15:20 +05:30
Suraj Shetty
4491f6c5b8 fix: Update recommended bundle of moment.js for browser
https://momentjs.com/timezone/docs/
this also helps reducing the bundle size
2023-06-26 09:14:17 +05:30
Suraj Shetty
fe25fe1db1 feat: A flag (--save-metafiles) to save esbuild metafiles
- Useful for analysing bundle size
2023-06-26 09:14:17 +05:30
Suraj Shetty
e4ff09ad6a test: Fix form flaky test 2023-06-26 09:14:17 +05:30
Suraj Shetty
e8fc200180 chore: Update dependencies 2023-06-26 09:14:17 +05:30
Suraj Shetty
efb8c24f72 chore: Upgrade vue v3.2 to v3.3
change log: https://blog.vuejs.org/posts/vue-3-3
2023-06-26 09:14:17 +05:30
Suraj Shetty
5581f960da chore: Update node version requirement in build config 2023-06-26 09:14:17 +05:30
Suraj Shetty
729c955665 chore: Update plyr to avoid build failures 2023-06-26 09:14:17 +05:30
Suraj Shetty
171b616e57 fix: Props should be constant as it is a read-only variable 2023-06-26 09:14:17 +05:30
Suraj Shetty
c44db90bed chore: Upgrade minimum required node version to 18
- Also update all the node packages
2023-06-26 09:14:17 +05:30
Ankush Menat
0e84fdaa6c build: bump RQ 2023-06-25 17:43:11 +05:30
Ankush Menat
1c27f99a11
Merge pull request #21475 from ankush/preload_modules
perf: pre-load common modules to reduce memory usage
2023-06-24 22:12:53 +05:30
Ankush Menat
af03b76c88 perf: Preload and share common python modules 2023-06-24 21:24:02 +05:30
Ankush Menat
793f4ebba3 perf: defer loading JWT 2023-06-24 19:50:08 +05:30
Ankush Menat
dc7620f0d8
Merge pull request #21474 from ankush/gc_freeze
perf: Freeze GC before forking Gunicorn workers
2023-06-24 17:41:59 +05:30
Ankush Menat
150c36c74d fix: collect before freezing 2023-06-24 17:36:10 +05:30
Ankush Menat
29d28a460f perf: Freeze GC right before starting background worker
BG worker forks are not CoW friendly. Freezing right before we start
worker should lessen overall memory usage. Though this isn't useful much
because at max you're sharing with 2 processes - master and horse.

WorkerPool can improve this benefit a lot by forking each worker from
master process and horse from forked processes. TBD when WorkerPool is
out of beta.
2023-06-24 17:06:23 +05:30
Ankush Menat
fbe3174914 perf: Bump alloc count to 7,000 for generation 0
This has overall 1-2% CPU usage reduction for little to no costs.
Benefits increase when doing bulk processing with lots of objects.
2023-06-24 17:02:45 +05:30
Ankush Menat
4f0a2e6e9c fix: move gc.freeze behind environ variable 2023-06-24 16:35:34 +05:30
Ankush Menat
32bd5d3e2c Revert "perf: defer many requests imports"
This reverts commit 71b44efcac.

This gets frequently imported from one place or another. Since with
gc.freeze we can mostly reuse the import from parent, let's just leave
it here.
2023-06-24 16:26:22 +05:30
Ankush Menat
cc43af984e fix: Only import LDAP if it's enabled
This is disabled on 99%+ sites, still incurs 3-4MB of memory hit on import of
ldap3.
2023-06-24 16:07:24 +05:30
Ankush Menat
423e781326 perf: Freeze GC before forking Gunicorn workers 2023-06-24 15:23:52 +05:30
Ankush Menat
278b6fc85a perf: defer QR code import 2023-06-24 15:22:01 +05:30
Ankush Menat
6a9c9bd89d perf: defer pydoc import 2023-06-24 15:22:01 +05:30
Ankush Menat
4c08689744 perf: defer psutil import 2023-06-24 15:22:01 +05:30
Ankush Menat
45f8aff909 perf: defer LDAP import 2023-06-24 15:22:01 +05:30
Ankush Menat
8a83226c60 perf: defer GoogleOAuth import 2023-06-24 15:22:01 +05:30
Ankush Menat
71b44efcac perf: defer many requests imports 2023-06-24 15:22:01 +05:30
Ankush Menat
4aa20c72c1 refactor: Simplify FrappeOAuth2Client
No need to override anything, use request.session in way it is intended.
2023-06-24 15:22:01 +05:30
Sagar Vora
54be05c18e
fix(Workspace): ignore is_hidden when importing standard workspaces (#21470) 2023-06-23 21:01:22 +05:30
Ankush Menat
c6419f52e2 perf: Move babel import to extract function
This is never used in production.

[skip ci]
2023-06-23 14:13:53 +05:30
Ankush Menat
8a37d6d278
perf: reduce memory usage of background processes (#21467)
* perf: defer translation.py imports

This indirectly imports babel which isn't really required most of the
time.

* perf: defer gzip import

* perf: move validate_and_sanitize_search_inputs

This causes all sorts of indirect imports and increases memory usage

* perf: defer requests module imports

* perf: defer system settings import

* perf: defer LOG_DOCTYPES import

Causes many indirect imports

* perf: defer update_site_config

* perf: defer notifications import

* perf: remove unused import

* perf: defer safe exec import

* test: memory usage overhead
2023-06-23 12:51:45 +05:30
Ankush Menat
fb11b5a1b0 fix(UX): better error message for Encryption key 2023-06-23 12:40:42 +05:30
Sayed Ayman
4ad98ecb7f
fix: use correct property name for filters in get_report_filters (#21465) 2023-06-23 01:56:52 +05:30
Ritwik Puri
e5dfb6d971
Merge pull request #21466 from barredterra/hooks-boilerplate
fix: hooks boilerplate
2023-06-23 01:53:44 +05:30
barredterra
15396ceb60 fix: add required_apps to hooks boilerplate 2023-06-22 15:48:04 +02:00
barredterra
d044b30522 fix: remove app_version from hooks boilerplate
It's not used by any frappe/erpnext code and linters complain about the
unused import
2023-06-22 15:47:34 +02:00
Rucha Mahabal
ba8f97e789 feat: before/after hooks for any app install/uninstall 2023-06-22 16:07:06 +05:30
Ankush Menat
085eb41245
ci: use multiple python version in patch test (#21443)
* ci: bump pyenv action

* ci: set default python version in patch test

* ci: setup pyenv manually

* ci: replace pyenv with setup-action

* debug

* use multiple python versions directly

* Revert "debug"

This reverts commit 692cbc0c9a407b86647ee09079fdde1510f300d7.

* setup py with --python flag
2023-06-22 13:48:20 +05:30