Re: [go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-06 Thread Nick Rio
Hi John, The application is working right now. Current work for me is to found a way to reduce it's memory footprint as it will take at least 1GB memory to hold only C10K idle connections. I know it's mainly me causing such memory usage, so I just want to know if there are a better way to get

Re: [go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-06 Thread Konstantin Khomoutov
On Mon, 6 Mar 2017 00:26:11 -0800 (PST) Nick Rio wrote: > The application is working right now. Current work for me is to found > a way to reduce it's memory footprint as it will take at least 1GB > memory to hold only C10K idle connections. > > I know it's mainly me causing such memory usage, s

Re: [go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-06 Thread Konstantin Khomoutov
On Mon, 6 Mar 2017 12:01:43 +0300 Konstantin Khomoutov wrote: > > The application is working right now. Current work for me is to > > found a way to reduce it's memory footprint as it will take at > > least 1GB memory to hold only C10K idle connections. > > > > I know it's mainly me causing such

RE: [go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-06 Thread John Souvestre
Ni Nick. Is 1GB too much? What is your target for number of connections and max memory size? You are using about 100KB per connection? Is there any way to reduce this? The goroutine certainly isn’t much of that. Perhaps some way of using a smaller buffer while idling? Go does us

[go-nuts] Re: [ANN] Enhanced Markdown template processor(emd): helper to generate README file

2017-03-06 Thread mhhcbon
Hi there! > Is it possible to support the codeship.com badges? Yes its possible to add support for this badge, It is just a template registered to the generator like this, https://github.com/mh-cbon/emd/blob/master/std/emd.go#L43 The codeship badge look likes this, https://codeship.com/proje

[go-nuts] Re: [ANN] Enhanced Markdown template processor(emd): helper to generate README file

2017-03-06 Thread mhhcbon
too early in the morning, and forgot to RTFM, i forgot the --data argument (see emd gen --help | grep data) So basically, just few code additions and you are good to go. (Hope for a better plugin deployment support in golang, that small program definitely will benefit of it and untie it w

[go-nuts] Re: sqlEZ: the easiest way to use a SQL database

2017-03-06 Thread mhhcbon
this not strictly related to your package, but as i m struggling too with DB management, just sharing. I m user of dbr, another orm like package, like yours it helps to deal with the db, and reduce its size. Both packages provide a way to execute sql queries more easily. None of the packages he

Re: [go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-06 Thread Nick Rio
Hi Konstantin, Thank you for the hit. I'll look into it. On Monday, March 6, 2017 at 5:25:47 PM UTC+8, Konstantin Khomoutov wrote: > > On Mon, 6 Mar 2017 12:01:43 +0300 > Konstantin Khomoutov > wrote: > > > > The application is working right now. Current work for me is to > > > found a way to

Re: [go-nuts] How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-06 Thread Jakob Borg
If most of your connections are idle most of the time, and your memory usage comes from something like buf := make([]byte, 65536) n, err := conn.Read(buf) // <-- block here for ever you could simply use a smaller buffer for the read that takes a long time. For example, if the message is length

Re: [go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-06 Thread Nick Rio
Well, 1 GB memory is certainly too many as they are mostly idle. They *should* cause as little as zero when in idle, right? I really hope they can add that (IO Notify Poll?) into Golang so I can implement my server in other models instead of One-Connection-One-Goroutine one. On Monday, March

Re: [go-nuts] How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-06 Thread Nick Rio
I don't know. I thought about it before but believe it will create some design complexity in my application. As currently I maybe able to re-implement some kind of polling mechanism from the ground level, I don't think I'll play that large'n'small buffer game. + It's always fun to play with the

Re: [go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-06 Thread Konstantin Khomoutov
On Mon, 6 Mar 2017 04:31:50 -0800 (PST) Nick Rio wrote: [...] > I really hope they can add that (IO Notify Poll?) into Golang so I > can implement my server in other models instead of > One-Connection-One-Goroutine one. The real problem with I/O notifications -- as you want them to work -- is th

[go-nuts] Re: 2016 Go User Survey results

2017-03-06 Thread mark
I haven't noticed an announcement on the mailing list yet, but I saw the corresponding Github issue closed with a link to the survey results: https://blog.golang.org/survey2016-results On Sunday, January 22, 2017 at 4:26:00 AM UTC-8, Matt Joiner wrote: > > The go user survey

[go-nuts] Load public key from DER encoded certificate

2017-03-06 Thread 0x7bc77a
Hi, I would like to load the public key from a DER encoded certificate Here is my code func ExampleParsePKIXPublicKey() { raw, err := ioutil.ReadFile("/Path/To/DER/Encoded/Certificate") if err != nil { panic("failed to read certificate" + err.Error()) } pub, err := x509.ParsePKIXPublicKey(raw)

Re: [go-nuts] Re: do {} for x, why or why not?

2017-03-06 Thread Jordan Krage
The spec says 'keyword' are "reserved and may not be used as identifiers", so adding any new keyword would necessarily break existing programs which use that keyword as an identifier, regardless of restrictions on the keyword's use. Perhaps you mean a less

[go-nuts] godoc: example wont show up

2017-03-06 Thread mhhcbon
Hi, in my package here, what did i do wrong so the ExampleMain won t show up ? https://github.com/mh-cbon/emd https://godoc.org/github.com/mh-cbon/emd Im expecting to see https://github.com/mh-cbon/emd/blob/master/main_test.go#L13 Note, go test works fine. thanks! -- You received this messa

Re: [go-nuts] godoc: example wont show up

2017-03-06 Thread Janne Snabb
Your example function is named ExampleMain(). This means that it is supposed to document function Main() or type Main. However, there is no function Main() or type Main in the package. Thus the example is not visible in the documentation because there is nothing for it to attach to. See for examp

[go-nuts] Re: How select mysql with Bind Param Using go

2017-03-06 Thread erfangnulinux
i see this, but also again not can do and bind param in select (mysql) On Sunday, March 5, 2017 at 2:09:04 PM UTC+3:30, Pierre Curto wrote: > > Have a look at https://golang.org/pkg/database/sql/#DB.Prepare. > > Le dimanche 5 mars 2017 11:07:28 UTC+1, erfang...@gmail.com a écrit : >> >> Hello, >>

Re: [go-nuts] Load public key from DER encoded certificate

2017-03-06 Thread Janne Snabb
You are trying to read a certificate with a function intended for reading a public key. Use x509.ParseCertificates instead. Janne Snabb sn...@epipe.com On 2017-03-06 16:39, 0x7bc77a wrote: > Hi, > > I would like to load the public key from a DER encoded certificate > > Here is my code > > fu

[go-nuts] go install does nothing - gives no error messages

2017-03-06 Thread vincent
go installation is fine, works properly for lost of packages But for this one application go install seems to do nothing and gives no warnings/messages or any output at all The packages can be built with build command and produce proper executables. Is the install command running some tests

[go-nuts] 2016 User Survey Results published

2017-03-06 Thread Steve Francia
Thanks to the 3,595 people who completed our end-of-year user survey! The results have been published at https://blog.golang.org/survey2016-results -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop recei

Re: [go-nuts] godoc: example wont show up

2017-03-06 Thread mhhcbon
thanks for your reply. yeah, that s right, ok, but what about TOC#5 ? That should work too, To achieve this we can use a "whole file example." A whole file example is a file that ends in _test.go✓ contains exactly one example function, ✓ no test

[go-nuts] Re: go install does nothing - gives no error messages

2017-03-06 Thread mhhcbon
Did you try go install -a -n -x -v -work ? $ go help build usage: go build [-o output] [-i] [build flags] [packages] The build flags are shared by the build, clean, get, install, list, run, and test commands: -a force rebuilding of packages that are already up-to-date. -

Re: [go-nuts] 2016 User Survey Results published

2017-03-06 Thread Pablo de la Concepción Sanz
Hi, First of all, thanks for collecting and sharing the info. I've noticed that on some questios, some answers are mostly the same but they are separate. For instance for "What one addition would make the biggest improvement to Go editing in your preferred editor?" The two top ones are "debugging"

Re: [go-nuts] godoc: example wont show up

2017-03-06 Thread Janne Snabb
It seems it is because it is "package main". See $GOPATH/src/golang.org/x/tools/godoc/static/package.html template. "IsMain" is set if the package is called "main". Looks like there is no way to output examples in that case. Janne Snabb sn...@epipe.com On 2017-03-06 19:25, mhhc...@gmail.com wr

Re: [go-nuts] 2016 User Survey Results published

2017-03-06 Thread Steve Francia
We are simply providing the common expressions used without any manipulation or groupings. Logically they do make sense to consider as a single topic. The survey promised the data provided would be kept confidential and anonymous. This promise makes it so we are unable to share the raw data. If an

Re: [go-nuts] 2016 User Survey Results published

2017-03-06 Thread Pablo de la Concepción Sanz
Hi Steve, I was more thinking on the raw agregeted data, the same that is published, sorry for the missundertunding. Best, Pablo On Mon, Mar 6, 2017 at 7:11 PM, Steve Francia wrote: > We are simply providing the common expressions used without any > manipulation or groupings. Logically they

Re: [go-nuts] 2016 User Survey Results published

2017-03-06 Thread Steve Francia
I'm not clear on what the aggregate data would provide beyond the results already published. It's a non-trivial amount of work to release, but if there's strong interest and reasons for doing so I'm happy to do it. On Mon, Mar 6, 2017 at 1:17 PM Pablo de la Concepción Sanz < pconcepc...@gmail.com>

Re: [go-nuts] 2016 User Survey Results published

2017-03-06 Thread Russ Cox
On Mon, Mar 6, 2017 at 12:42 PM, Pablo de la Concepción Sanz < pconcepc...@gmail.com> wrote: > Hi, > > First of all, thanks for collecting and sharing the info. I've noticed > that on some questios, some answers are mostly the same but they are > separate. For instance for "What one addition would

[go-nuts] go install does nothing - gives no error messages

2017-03-06 Thread Dave Cheney
go install -v -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout

[go-nuts] How to create unique IDs when ranging over data in Golang and use in Javascript

2017-03-06 Thread Rejoy
I am getting data from the server and iterating over it to create a table and then I am using a form to store an id to local storage using javascript. Here is code snippet Product ID {{range .}} Update {{end}} function save_data() { var input = document.getElementByID("pid");

Re: [go-nuts] How to create unique IDs when ranging over data in Golang and use in Javascript

2017-03-06 Thread Konstantin Khomoutov
On Mon, 6 Mar 2017 23:30:20 -0800 (PST) Rejoy wrote: > I am getting data from the server and iterating over it to create a > table and then I am using a form to store an id to local storage > using javascript. Here is code snippet > > > Product ID This loop > {{range .}} > class=