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

why donot support fcgi method to serve? #1715

Open
visamz opened this issue Dec 25, 2018 · 1 comment
Open

why donot support fcgi method to serve? #1715

visamz opened this issue Dec 25, 2018 · 1 comment
Labels
Milestone

Comments

@visamz
Copy link

visamz commented Dec 25, 2018

  • With issues:
    why donot support fcgi method to serve?

  • go version: 1.11.2

  • gin version (or commit ref): 1.30

  • operating system: centos

Description

see the rel issue #673 , the reason is much slower than unix http proxy.

But, in go 1.11.2, unix http is slower than unix fcgi

go:

// fcgi usocket
func (engine *Engine) RunFcgiUnix(file string) (err error) {
	debugPrint("Listening and serving FCGI on unix:%s", file)
	defer func() { debugPrintError(err) }()

	os.Remove(file)
	listener, err := net.Listen("unix", file)
	if err != nil {
		return
	}

	os.Chmod(file, 0777)
	defer listener.Close()
	err = fcgi.Serve(listener, engine)
	return
}

nginx conf:

# fcgi usocket
location ~ ^/(\S+)/{
        #fastcgi_pass   unix:/data/usock/demo.sock;
        include        fastcgi_params;
}

# http usocket
location ~ ^/(\S+)/{
        proxy_pass  http://unix:/data/usock/demo.sock;
}

Screenshots

fcgi usocket

image

http usocket

image

@appleboy
Copy link
Member

@visamz Can you send the PR?

@appleboy appleboy added this to the 1.4 milestone Dec 29, 2018
@thinkerou thinkerou modified the milestones: 1.4, 1.5, 1.x Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants