Skip to content

Commit

Permalink
Merge pull request #49 from rryqszq4/development
Browse files Browse the repository at this point in the history
[pr] release version to 0.0.17
  • Loading branch information
rryqszq4 authored Jun 2, 2019
2 parents 31f4be0 + 09377de commit 383bc95
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
15 changes: 15 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
ngx_php7 0.0.17 changes: 01 Jun 2019
* Add php impl ngx_redirect.

* Fixed mysql handshake error.

* Fixed add handler post data at rewrite and access phase.

* Fixed the directive rewrite_by_php has not been extended in context configuration.

* Fixed error handler coredump.

* Fixed ngx_exit memory leak.

* Fixed socket receive memory leak.

ngx_php7 0.0.16 changes: 01 Feb 2019
* Add php impl ngx_header_set, ngx_header_get and ngx_header_gets.

Expand Down
2 changes: 1 addition & 1 deletion src/ngx_http_php_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#define NGX_HTTP_PHP_MODULE_NAME "ngx_php"
#define NGX_HTTP_PHP_MODULE_VERSION "0.0.16"
#define NGX_HTTP_PHP_MODULE_VERSION "0.0.17"

#ifndef NGX_HTTP_PERMANENT_REDIRECT
# define NGX_HTTP_PERMANENT_REDIRECT 308
Expand Down
2 changes: 2 additions & 0 deletions src/ngx_http_php_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ ngx_http_php_socket_connected_handler(ngx_http_request_t *r,
ngx_http_php_socket_upstream_t *u)
{
ngx_php_debug("php socket connected handler");
u->read_event_handler = (ngx_http_php_socket_upstream_handler_pt) ngx_http_php_socket_dummy_handler;
u->write_event_handler = (ngx_http_php_socket_upstream_handler_pt) ngx_http_php_socket_dummy_handler;
}

static ngx_int_t
Expand Down
8 changes: 4 additions & 4 deletions t/lib/mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ private function write_packet($data, $len, $chr=1) {

private function read_packet() {
#var_dump("read_packet");
do {
//do {
$data = '';
yield ngx_socket_recv($this->socket, $data, 4);
} while (empty($data));
#$this->print_bin($result);
//} while (empty($data));
#$this->print_bin($data);
$field_count = unpack('v', substr($data, 0, 3))[1];
#var_dump("field_count: ".$field_count);
//$data = '';
Expand Down Expand Up @@ -346,7 +346,7 @@ private function field_data_packet($result) {
#var_dump($db);
$field['table'] = $table = $this->parse_field_data($result, $start);
#var_dump($table);
$field['ori_table'] == $ori_table = $this->parse_field_data($result, $start);
$field['ori_table'] = $ori_table = $this->parse_field_data($result, $start);
#var_dump($ori_table);
$field['column'] = $column = $this->parse_field_data($result, $start);
#var_dump($column);
Expand Down

9 comments on commit 383bc95

@rryqszq4
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joanhey hi, ngx_php7 released a new version, please help update.

@joanhey
Copy link
Contributor

@joanhey joanhey commented on 383bc95 Jun 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the last 2 runs failed, and there aren't any changes only the php updates.
https://tfb-status.techempower.com/unzip/results.2019-06-08-20-01-34-978.zip/results/20190605052508/php-ngx/run/php-ngx.log

The dockerfile:
https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/PHP/php/php-ngx.dockerfile
Not changed in the last 4 months, and only failed in the last 2 runs.

Ready the new version 0.0.17, nignx 1.17.0 and ubuntu 19.04, all compiled without problems.
https://github.com/joanhey/FrameworkBenchmarks/commits/php-ngx
But still with the same problem:
php-ngx: 2019/06/10 13:30:35 [alert] 7#0: worker process xx exited on signal 11 (core dumped)

@rryqszq4
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joanhey
A new pull request #50 about this problem, please waiting for a new tags.

@joanhey
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The swoole server don't have database pooling.
And they use that:
https://github.com/joanhey/FrameworkBenchmarks/blob/php-ngx/frameworks/PHP/swoole/swoole-server.php#L203-L263

Perhaps you can code something similar.

@rryqszq4
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swoole is very powerful, but I still refer to the openresty design because it affects me too deeply.Will use the connection pool of nginx.

@rryqszq4
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joanhey
Currently, the non-blocking mysql driver https://github.com/rryqszq4/ngx_php7/blob/master/t/lib/mysql.php is ready, but the short link does not have a connection pool, and after adding some demos, you can run it. The connection pool still needs to wait for the first time.

@joanhey
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question:
Will the new https://wiki.php.net/rfc/preload affect the performance in php-ngx?

Or will be almost the same to php-ngx ?

@joanhey
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's working correctly with 0.0.18.
Just send the PR.

@rryqszq4
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question:
Will the new https://wiki.php.net/rfc/preload affect the performance in php-ngx?

Or will be almost the same to php-ngx ?

@joanhey
I think preload does not affect the performance of ngx_php.

Please sign in to comment.