Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added parallel extension #408

Closed
wants to merge 1 commit into from
Closed

Added parallel extension #408

wants to merge 1 commit into from

Conversation

hschimpf
Copy link

@hschimpf hschimpf commented Mar 10, 2023

Extension reference

Dependencies

  • AWS Lambda PHP layer compiled with ZTS flag enabled

Current CI / Build and test layer fails because this extension needs PHP with ZTS enabled

Please, refer to brefphp/aws-lambda-layers#63 for more details.

* Needs PHP build with --enable-zts flag
@Nyholm
Copy link
Collaborator

Nyholm commented Mar 28, 2023

Thank you. I put this on hold until there is a decision about ZTS.

FYI, I think I suggested to remove it years ago because "nobody is using pthreads or parallel anyways".

@mnapoli
Copy link
Member

mnapoli commented Mar 28, 2023

👍 will post an update here when the ZTS PR is merged.

Basically what we are going with is: allow users to enable ZTS and recompile PHP runtimes, but it won't be in official Bref runtimes. So that extension will only work for those who will recompile PHP layers themselves.

Latest update brefphp/aws-lambda-layers#63 (comment)

@hschimpf
Copy link
Author

hschimpf commented Mar 28, 2023

exactly, it will be for special cases and will have to be compiled manually compiled along with the PHP runtimes with ZTS enabled.

I only have one doubt, since this extension requires the runtimes with ZTS enabled, every PR will fail when the test on layers runs?

@hschimpf
Copy link
Author

FYI, I think I suggested to remove it years ago because "nobody is using pthreads or parallel anyways".

Parallelism programming is a completely different world on programming, and even more in PHP since is not a built-in feature of the language. I must be one of the few who use parallelism in PHP. Sharing data between threads and maintain synchronization between them requires a complex understanding of the libraries and your needs.

I had a special requirement on a project with a lot of data (details on brefphp/aws-lambda-layers#63), and I was looking a way to reduce costs on AWS Lambda. Since lambda gives us with some cores (based on memory settings), I pointed my goal in that direction and build some heavy demanding processes using parallelism. Another limitation on Lambda is the max execution time of 15min, so the more information I can process in that time, the better.

I would like to share an utility that I build for parallelism on PHP if that's ok.
For anyone if it is useful, Parallel SDK is a layer on top of parallel extension.

@mnapoli
Copy link
Member

mnapoli commented Mar 28, 2023

FYI we merged the PR for ZTS in Bref layers.

To be clear, ZTS is not enabled in Bref layers, but users can rebuild runtimes with it if they wish to.

@hschimpf hschimpf deleted the branch brefphp:v2 April 19, 2023 00:05
@hschimpf hschimpf closed this Apr 19, 2023
@hschimpf hschimpf deleted the v2 branch April 19, 2023 00:05
@hschimpf
Copy link
Author

Since branch v2 was merged to master, I made another PR #431 on the master branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants