[Koha-devel] Interesting syscalls when Starman starting up

Tomas Cohen Arazi tomascohen at gmail.com
Wed Apr 26 13:56:43 CEST 2023


Koha has been using the Swagger/OpenAPI plugin since... 2015.

The validation step is important, especially when there are API plugins.
Plugins can break the API, and we need to check that. I'd like to hear
opinions about that,  though. And I am open to changing my mind.

Best regards

El mié, 26 abr 2023 a las 4:13, David Cook (<dcook at prosentient.com.au>)
escribió:

> Hey all,
>
>
>
> Years ago, I chatted with the author of Mojolicious::Plugin::OpenAPI about
> skipping the schema validation as it was causing extremely high server load.
>
>
>
> He added a config option for it in a newer version, and that version is
> available for Koha 22.11. I’ve tried turning on that config option but not
> sure if it’s working. I have more exploring to do.
>
>
>
> When I startup Starman for Koha 22.11, I still see a huge server load, and
> when I use strace, I see a long loop of the following:
>
>
>
> newfstatat(AT_FDCWD, "/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...},
> AT_SYMLINK_NOFOLLOW) = 0
>
> newfstatat(AT_FDCWD, "/usr/share", {st_mode=S_IFDIR|0755, st_size=4096,
> ...}, AT_SYMLINK_NOFOLLOW) = 0
>
> newfstatat(AT_FDCWD, "/usr/share/koha", {st_mode=S_IFDIR|0755,
> st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
>
> newfstatat(AT_FDCWD, "/usr/share/koha/api", {st_mode=S_IFDIR|0755,
> st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
>
> newfstatat(AT_FDCWD, "/usr/share/koha/api/v1", {st_mode=S_IFDIR|0755,
> st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
>
> newfstatat(AT_FDCWD, "/usr/share/koha/api/v1/swagger",
> {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
>
> newfstatat(AT_FDCWD, "/usr/share/koha/api/v1/swagger/swagger.yaml",
> {st_mode=S_IFREG|0644, st_size=27644, ...}, AT_SYMLINK_NOFOLLOW) = 0
>
> newfstatat(AT_FDCWD, "/usr/share/koha/api/v1/swagger/swagger.yaml",
> {st_mode=S_IFREG|0644, st_size=27644, ...}, 0) = 0
>
> newfstatat(AT_FDCWD, "/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...},
> AT_SYMLINK_NOFOLLOW) = 0
>
> newfstatat(AT_FDCWD, "/usr/share", {st_mode=S_IFDIR|0755, st_size=4096,
> ...}, AT_SYMLINK_NOFOLLOW) = 0
>
> newfstatat(AT_FDCWD, "/usr/share/koha", {st_mode=S_IFDIR|0755,
> st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
>
> newfstatat(AT_FDCWD, "/usr/share/koha/api", {st_mode=S_IFDIR|0755,
> st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
>
> newfstatat(AT_FDCWD, "/usr/share/koha/api/v1", {st_mode=S_IFDIR|0755,
> st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
>
> newfstatat(AT_FDCWD, "/usr/share/koha/api/v1/swagger",
> {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
>
> newfstatat(AT_FDCWD, "/usr/share/koha/api/v1/swagger/swagger.yaml",
> {st_mode=S_IFREG|0644, st_size=27644, ...}, AT_SYMLINK_NOFOLLOW) = 0
>
> newfstatat(AT_FDCWD, "/usr/share/koha/api/v1/swagger/swagger.yaml",
> {st_mode=S_IFREG|0644, st_size=27644, ...}, 0) = 0
>
>
>
> I’m guessing that might be caused by the following lines:
>
>
>
> $schema->resolve( $spec_file );
>
> my $spec = $schema->bundle->data;
>
>
>
> But I’ll have to investigate more…
>
>
>
> Koha used to start up quickly and with minimal overhead. Back when I was
> looking at Mojolicious::Plugin::OpenAPI, if I skipped the validation, I
> could start up with minimal overhead as well. Looks like things have
> changed over the past few years to keep the problem happening…
>
>
>
> David Cook
>
> Senior Software Engineer
>
> Prosentient Systems
>
> Suite 7.03
>
> 6a Glen St
>
> Milsons Point NSW 2061
>
> Australia
>
>
>
> Office: 02 9212 0899
>
> Online: 02 8005 0595
>
>
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : https://www.koha-community.org/
> git : https://git.koha-community.org/
> bugs : https://bugs.koha-community.org/
>


-- 
Tomás Cohen Arazi
Theke Solutions (http://theke.io)
✆ +54 9351 3513384
GPG: B2F3C15F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20230426/22cae86a/attachment.htm>


More information about the Koha-devel mailing list