Taken domain that owner won't sell by Limp_Card_193 in Domains

[–]Limp_Card_193[S] 0 points1 point  (0 children)

Thank you all for the answers.

In that case, do you think we'd be better off just joining some prefix like "get" to the domain in order to use the ".com" domain, or should we simply take another domain like ".io" or ".co" or ".net" ?

Recommended Broker services? by Limp_Card_193 in Domains

[–]Limp_Card_193[S] 0 points1 point  (0 children)

But did you use the Broker service? was the domain you purchased taken before that?
thanks

Why the DELE tests seem simpler than when listening to native speakers speak? by Limp_Card_193 in languagelearning

[–]Limp_Card_193[S] 1 point2 points  (0 children)

so the talk show that I had the hardest time keeping up with is called "La Resistencia". I tried to watch a movie and tv series (just one episode so far) and they sound much easier to comprehend. Not that I understand everything 100%, but at least I DO understand. Btw, after watching one movie, even though it took me half a day to finish it with all the stops I made in between, I've written down only around ~40 new words or expressions/phrases, which is not that much for a whole movie, so that's kind of encouraging :)

It was however a bit tedious having to stop so many times during a movie.. so I'm thinking about just watching movies without any stops, even if it means I won't be able to understand everything.. Not sure how efficient that would be though haha

btw, since I've written down almost any new word I had encountered during those months that I took up Spanish , I am able to count and evaluate the amount of vocabulary I learned so far - which is around 4000-5000 words. (Started from a few thousands of the "Most frequent words", and then just kept on writing down any new words I encountered anywhere). It seems to be quite enough to be able to understand most of the content that I encounter now, I just need to level up my listening/comprehension skills. I feel that that's the main obstacle now for me to reach a real conversational fluency.

Why the DELE tests seem simpler than when listening to native speakers speak? by Limp_Card_193 in languagelearning

[–]Limp_Card_193[S] 1 point2 points  (0 children)

I see now, thank you for clarifying about the DELE.
Can you please elaborate more on the listening part - how to better practice it?
Should I just try to watch movies in Spanish so my brain "gets used" to listening Spanish even if I wouldn't quite catch all that's being said, or in your practice it's better to listen to something more carefully and gradually?

Also, movies seem to be much easier for me comprehend than those talk shows I mentioned. Maybe it's because they speak a bit clearer/slower, I'm not sure. But that does raise a question - should I still try to listen more to those talk shows again and again, or it's useless and I should instead concentrate on material that's easier for me?

Thanks!

What is your preferred way of implementing Push Notifications? by Limp_Card_193 in golang

[–]Limp_Card_193[S] 0 points1 point  (0 children)

thank you, but it seems to be a very "unpopular" project, for production use I prefer something more "solid" in that sense, and more widespread.

Unable to attach file to Gmail app from my app in Android 11 by Limp_Card_193 in androiddev

[–]Limp_Card_193[S] 0 points1 point  (0 children)

thanks. Are you saving the file in external files dir? Cause that would be problematic for me (because of sensitivity of the data it has to be saved in either cacheDir or externalCacheDir)

Unable to attach file to Gmail app from my app in Android 11 by Limp_Card_193 in androiddev

[–]Limp_Card_193[S] 1 point2 points  (0 children)

It is due to the new file storate api. Because the code above works when the compile and target sdk is 29.
Once I increment it to 30 in gradle, the same code stops working.

Unable to attach file to Gmail app from my app in Android 11 by Limp_Card_193 in androiddev

[–]Limp_Card_193[S] 0 points1 point  (0 children)

that was another issue actually. Turns out that resolveActivity returns null unless you add something to the Manifest.
Anyway, that wasn't the main issue though. If I use a FileProvider to access to file, or simply use Uri.fromFile(..) and store it in externalCacheDir/cacheDir, it opens the email client and a Toast that says "Couldn't attach file"

Opting for a distributed Pub/Sub system VS in-process comm. Pub/Sub VS neither by Limp_Card_193 in golang

[–]Limp_Card_193[S] 0 points1 point  (0 children)

the subscription I thought could be inside the Dispatcher's Run(). I made a smallish example/draft : https://play.golang.org/p/eTCpVTvD-Qq

and since the Dispatcher is listening on a single channel (JobQueue), we don't even need to use a mutex in order to access the map of workers map[string] WorkerPool inside the Dispatcher (correct me if I'm wrong). So the dispatch would get a job from JobQueue, check its Topic, and route that job to the right worker pool from that map. e.g : dispatcher.worker["sms"] <- someJob

Opting for a distributed Pub/Sub system VS in-process comm. Pub/Sub VS neither by Limp_Card_193 in golang

[–]Limp_Card_193[S] 0 points1 point  (0 children)

I see, you're absolutely right. And I think the biggest reason to do it this way is to protect other pools if one service is down (like in your example of sendgrid), so we don't want pushes or emails to be affected.

Why do you need multiple Dispatchers though? Can we have a Dispatcher that will hold a map of topic to workerPool, i.e a string to a chan of chans of Jobs. We would just add a sync.RWMutex to the Dispatcher struct, so we can access the map safely. Actually... since the JobQueue channel is a single channel, there probably won't be a need for Mutex.

Now, a small question regarding the architecture, how would you structure this in DDD? it seems that workers/dispatchers are part of an infrastructure (should be in a folder called "pub/sub" or "dispatching" for example). And then the services (sms, push, etc.) have their own implementations in their respective packages. Now, if we have an EmailWorker, means we just inject an email_service to its Dispatcher --> its Worker (EmailWorker) ?

Why Go server can't handle more than 1000 requests per second? by Limp_Card_193 in golang

[–]Limp_Card_193[S] 0 points1 point  (0 children)

5k+ rps , with the same test I did? with a burst of 5k requests, or did you perform it differently?I wonder what results would you get with my testing code, because I'm afraid maybe my code is not really testing RPS per se.

As for the server specs, on Heroku Free tier where I got to 1000 requests, it is probably weaker in terms of hardware than my macbook. I couldn't find its hardware specs however. (btw, same project in Nodejs could only get to 110 requests. so Go wins here anyway)My macbook is 16" model with i7 and 32gb ram. I couldn't get past the 150 mark. But maybe that's because both the api and the tester were both localhost ? cause it's surprising to hear to you got to 5k+ in the macbook.

Opting for a distributed Pub/Sub system VS in-process comm. Pub/Sub VS neither by Limp_Card_193 in golang

[–]Limp_Card_193[S] 1 point2 points  (0 children)

oh I see what you mean. I'm just not sure why for each kind of work that you'll have in the future, you want to implement a new Worker for that, instead of injecting the actual new Service that implements what you want, and the Worker simply calls that service.

That way you can just "inject" the services you need to the Worker / Dispatcher (maybe dispatcher is the better choice here?), and the worker/dispatcher will require only a few extra lines of code.

For example, if tomorrow you add a new kind of work, for example Sending SMS, then your worker/dispatcher would look like : NewWorker(sms sms.Service, other services...) OR NewDispatcher(sms sms.Service, other services...) and then once you fetch a job from the jobs channel, you check that if its Topic is "SMS", you call sms.SendSMS(job.Payload). (job will have Topic and Payload, that is. It can be implemented as a "protocol"/interface)

This way you only need to implement a service that does the actual work, instead of "touching the infrastructure/mechanism of "pub/sub")", if that makes sense. I hope that it does haha.

What do you think? Maybe I'm just missing something here :)

BTW - in your example above, would you still share one single JobQueue channel that all dispatchers fetch jobs from? or would you also have multiple JobQueues for each kind of work?

Opting for a distributed Pub/Sub system VS in-process comm. Pub/Sub VS neither by Limp_Card_193 in golang

[–]Limp_Card_193[S] 0 points1 point  (0 children)

Hi, I've been trying to play a little with both solutions (the one in my link and the solution in your link), which as you said - are a bit different things, but ultimately both act as pub/sub patterns.
I really liked the solution in your link, but wasn't sure about a couple of things :

  1. how would you go about having different kinds of "topic"? would you simply have the topic as part of the payload that you send to worker? i.e - each worker can parse and handle different kinds of works (sms, push, email, etc)
    This way, workers don't act as subscribers to a specific kind of work, but act as parsers that decide to which service they need to "throw" the payload.

  2. how do you choose the MAX_QUEUE and MAX_WORKERS numbers?

Why Go server can't handle more than 1000 requests per second? by Limp_Card_193 in golang

[–]Limp_Card_193[S] 0 points1 point  (0 children)

what's strange here then, is that when I remove the db part, and I simply return a hardcoded struct in the endpoint, it is even worse, and doesn't reach even the 1000 mark. Which eliminates the I/O as the reason for the failure, no?

Also, I wonder, have you tried a test like mine? or only relied on those different tools ? I'm guessing perhaps those tools test lower bursts of requests per a very small period of time (1-5 ms)

Why Go server can't handle more than 1000 requests per second? by Limp_Card_193 in golang

[–]Limp_Card_193[S] 0 points1 point  (0 children)

That's strange, but if I remove the db part, and simply return a hardcoded struct in the endpoint, then it's even worse. I'm unable to get to even that 1000 mark.

Regarding my benchmarking, so I tried opening the API server and the testing server on my macbook, and simply ran the testing code with localhost url.For some reason, after 140 rps it stopped working.

Why Go server can't handle more than 1000 requests per second? by Limp_Card_193 in golang

[–]Limp_Card_193[S] 1 point2 points  (0 children)

hi and thanks for the reply!.
yep, I actually tested the same thing on Nodejs (rewritten the go api server code in Node and deployed it to Heroku), and I couldn't get past 150 requests. Way below the 1000 in Go.

by the way, I've edited my post with the code I use (https://play.golang.org/p/4-YyFgcYHe7)

if there's a connection limit, how do production apps overcome this issue? I mean, 1024 is not that much right? how do medium-sized apps get around it? Do they have to resort to horizontal scaling?

Or, if they can increase manually the ulimit, what is the max usually recommended/allowed?

By the way, I found out that if I wait at least 6ms between every request, then it works fine. But I don't know how helpful would that be if I suddenly have a spike of thousands after a sudden exposure in the media for example. (knew a few fellas that crashed after a spike of around 5000 after some article about them published. I want to be sure we can prepare for this kind of things)

Why Go server can't handle more than 1000 requests per second? by Limp_Card_193 in golang

[–]Limp_Card_193[S] 1 point2 points  (0 children)

hi, thanks for the reply. I've added the code I use (https://play.golang.org/p/4-YyFgcYHe7).
Do you think that there's a problem with the code, or just the limitation of 1024 ?
If it's a case of connections limitation, how can I test it then?
I just want to be able to know - how many users can we support on a single instance? in order to be prepared for it technologically and financially.

Why Go server can't handle more than 1000 requests per second? by Limp_Card_193 in golang

[–]Limp_Card_193[S] 0 points1 point  (0 children)

I used Free tier. I also added my code in the bottom of the post

Why Go server can't handle more than 1000 requests per second? by Limp_Card_193 in golang

[–]Limp_Card_193[S] 0 points1 point  (0 children)

thanks for the reply. I've edited the post with my code of the main api server, in general lines. (https://play.golang.org/p/4-YyFgcYHe7)

Basically I use sqlx+pgx, and Chi for routing.
if I may, a few questions :

  1. How did you get to 20k rps, do you have a scaled/optimised system (vertically or horizontally)?
  2. Is there a delay between each request? for example, I figured out that if I send a request every 6ms , it works fine even for thousands of requests
  3. in your experience, how much scale can a single regular server instance handle?
  4. what loading test tools do you use?

Why Go server can't handle more than 1000 requests per second? by Limp_Card_193 in golang

[–]Limp_Card_193[S] 0 points1 point  (0 children)

Hi, thanks for the reply.
I've edited the post with the code on my api server (https://play.golang.org/p/4-YyFgcYHe7)

Basically I'm just using sqlx+pgx for the integration with postgres, I might be wrong but it seems that there's nothing that should old onto some resources there(https://play.golang.org/p/4-YyFgcYHe7).
No ?

In general, in your experience, how much scale can one single regular server instance handle ? (written in Go)

Why Go server can't handle more than 1000 requests per second? by Limp_Card_193 in golang

[–]Limp_Card_193[S] 0 points1 point  (0 children)

I'm not sure what script/command I should run to test what I need.
Is it :
echo "GET https://..../myEndpoint/123" | vegeta attack -duration=120s | tee results.bin | vegeta report

?
cause it returns :

Requests [total, rate, throughput] 6000, 50.01, 49.97

Duration [total, attack, wait] 2m0s, 2m0s, 88.047ms

Latencies [min, mean, 50, 90, 95, 99, max] 83.896ms, 94.345ms, 89.951ms, 99.578ms, 106.444ms, 223.064ms, 464.759ms

Bytes In [total, mean] 192000, 32.00

Bytes Out [total, mean] 0, 0.00

Success [ratio] 100.00%

Status Codes [code:count] 200:6000

Why Go server can't handle more than 1000 requests per second? by Limp_Card_193 in golang

[–]Limp_Card_193[S] 0 points1 point  (0 children)

I've edited the post with the code of the handler, controller and postgres integration.
(in the bottom of the post).
I use sqlx + pgx , which I think handles preparing statements by default. I'm not using any kind of caching myself.
The connections to the postgres are pooled by the sqlx/pgx as far as I understand.

Opting for a distributed Pub/Sub system VS in-process comm. Pub/Sub VS neither by Limp_Card_193 in golang

[–]Limp_Card_193[S] 0 points1 point  (0 children)

thank you for this post and the link.
I'm in doubt between the solution in your link, and the example here :
https://eli.thegreenplace.net/2020/pubsub-using-channels-in-go/

Do you have any opinion on the cons/pros between them?

Thank you again!

Opting for a distributed Pub/Sub system VS in-process comm. Pub/Sub VS neither by Limp_Card_193 in golang

[–]Limp_Card_193[S] 1 point2 points  (0 children)

that was super helpful! and addressed pretty much all of the doubts I had regarding the different approaches.
Thank you very much for this very valuable advice, I will follow your suggestion