310 karma · joined March 24, 2015
I write fast code, fast.
> you've demonstrated to the world in this thread you have no idea how virtual memory works
Funny, I kind of consider myself an expert in virtual memory and I previously made no mention of virtual memory in any of my comments. I do consider virtual memory an extremely important part in getting high levels of performance from a cache. Did you confuse sendfile() and copying data from block devices into userspace with virtual memory?
Why am I not surprised at this reply.
Really? I would say most of us are comfortable with how Nginx and ATS are engineered and how the kernel works.
If anything, I think the concern is the fact that you are working for a publicly traded CDN yet you came to this thread armed with nothing more than a load of BS and FUD. I will say this connected a few dots in my mind and possibly added some color to what others think.
> epoll/kqueue
Here is the implementation from 2.1, back maybe around 10 years ago:
https://github.com/varnishcache/varnish-cache/blob/2.1/bin/v...
https://github.com/varnishcache/varnish-cache/blob/2.1/bin/v...
> nginx thread model
https://www.nginx.com/blog/thread-pools-boost-performance-9x...
> With sendfile(2) and splice(2) you are only wiring up the activity to be done in your event loop
Why you are storing your cache on disk into individual files when its "2018 and RAM is commonly measured in many hundred GB" is beyond me. But its not even worth discussing because you will just introduce more BS, FUD, and techno babble.
> Varnish I/O model is ignorant of TLB flushing, instruction cache, VM hints like madvise(2), and the overhead (and downright difficult job) of an OS scheduler.
TLB flushing is a hardware problem, not a software problem. Instruction cache? Last I checked, the varnishd binary is about 2MB and uses very predictable jumping and straight function calling. Im pretty sure your going to be getting a 99% instruction cache hit rate. Madvise is used in Varnish's storage engine's, and there seems to be little interest or knowledge about how Varnish uses storage here.
> If my points didn't have some validity, Fastly would not have done what they did.
Can you expand on what Fastly did? They published a non locking memory allocator? So the claim is that memory allocation is the bottleneck and jemalloc is not suitable?
Sounds like someone might be stuck in performance hell and you are trying to draw parallels to Varnish which simply don't exist!
A better statement here would be connections are serviced by a pool of workers. Event polling is used. A single worker can and does process tens of thousands of requests a second. Workers are used to get request parallelism across multiple cores. When a request blocks, that worker will work on another request. Varnish easily beats out pure event driven software in 99perc response times because of its worker pool designed. Very puzzling that you are claiming otherwise.
> going to be dropping performance on the floor vs other I/O models as you get into the 1000s of connections
I have done benchmarks with over 100,000 active connections a second, with a mix of blocked, slow, fast connections, cache hits, misses, and passes. Performance is great, ~100us response times, very low CPU utilization.
> So be prepared to do some deep systems work if you need high scalability out of Varnish.
Not at all. Once again, I did some benchmarks not too long ago and was able to get 100Gbit/sec using a stock Varnish + stock Linux. Response time was well under 1ms per request.
Hitting high levels of scale and performance is an IO problem, not really a CPU problem. A lot of the criticism here is misinformed and focused on CPU scheduling. Not a single mention about any of the IO optimizations used in Varnish and other competing products.
NY Times topped $1 billion in subscription revenue last year. Quite a feat and definitely an indication that money is to be made in digital news.
https://www.nytimes.com/2018/02/08/business/new-york-times-c...
Once again, why would a compiler do that? To satisfy the Rust community's desire to spread FUD throughout the C community? (sorry to be so blunt, but im really scratching my head here)
A more logical thought process here is that signed operations aren't uniform across architectures and are sometimes emulated, leading to UB for certain edge cases, like overflow. Its more practical to believe that a future C standard will fix this loophole rather than think compilers will exploit this and punish their own community.
Very not impressed with this thread.
vec.capacity = 0;
Next, line 26: int new_capacity = vec->capacity * 2;
So we get new_capacity = 0 * 2, so new_capacity is 0. The assert: assert(new_capacity > vec->capacity);
Which translates to 0 > 0, it triggers a fail and we are done. If the compiler were to 'optimize' that out, then the compiler just introduced a very serious and fatal bug in our program, and we didn't even overflow or UB.So that assert works as intended, it forces new_capacity to grow until it hits INT_MAX or UB, at which point it will assert.
I do not think its plausible that the compiler is emitting code which checks for an overflow and then in a deterministic fashion skips all dependent logic there after. Im sorry, but I think this line of argument has been taken to such an extreme it has detached from reality.
Not sure I understand why you think the assert() gets removed. Is this documented somewhere?
Hint: vec->capacity could be 0
int new_capacity = vec->capacity * 2;
assert(new_capacity > vec->capacity); > valgrind ./a.out
==4871== Invalid write of size 4
==4871== at 0x40073A: vec_push (test.c:40)
==4871== Invalid write of size 4
==4871== at 0x40073A: vec_push (test.c:40)
==4871== Invalid read of size 4
==4871== at 0x4007CD: main (test.c:55)
==4871== Invalid read of size 8
==4871== at 0x400769: vec_free (test.c:46)
==4871== Invalid free() / delete / delete[] / realloc()
==4871== at 0x4C2BDEC: free (...)
==4871== by 0x400770: vec_free (test.c:46) > gcc test.c
I get an error: test.c:21:3: warning: function returns address of local
variable [-Wreturn-local-addr]
return &vec;
After I fix that error, the program segfaults when running. Compile with asan: > gcc test.c -Fsanitize=address -lasan -g
Then we can start debugging these problems: ==3261== ERROR: AddressSanitizer: attempting double-free on 0x60040000dfd0:
...
#2 0x4008b5 in vec_free ./test.c:46
Not trying to say that this is the best workflow for debugging C, but the tooling does exist for these kinds of programming errors.Varnish Software is the company behind Varnish Cache. Varnish Software works with top global enterprises helping them use Varnish Cache to increase web performance and to build private CDNs, consumer CDNs, and advanced edge platforms.
At Varnish Software, we take pride in our software and products and we value innovation. We strive to hire team members who share these values. We offer an open, honest, and international culture in a laid back and stimulating work environment. You will be working with some of the most brightest and talented people in the industry. We offer competitive salaries, full benefits, generous vacation time, and much more.
Job description:
* Create, develop and maintain Varnish products and solutions
* Provide technical guidance and industry best practices to customers
* Interact with prospects during the sales process
* Hacking on various projects (side projects encouraged)
* International travel for customer meetings, conferences, and office workshops
Desired skills and experience:
* Experience with Varnish Cache and VCL
* Experience with C, scripting languages, Linux programming
* Good understanding of TCP and HTTP protocols and troubleshooting tools
* Comfortable explaining technical solutions and details to a non-technical audience
* Public speaking or writing experience is a plus
To apply, please send your resume or questions to jobs@varnish-software.com
Varnish Software is the company behind Varnish Cache, a widely recognized open source HTTP proxy that significantly enhances web performance and enables digital content delivery. Varnish Cache has experienced tremendous growth since its inception and currently powers more than 2.8 million websites globally.
Varnish Software works with top global enterprises helping them use Varnish Cache to increase web performance and to build private CDNs, consumer CDNs, and advanced edge platforms. Over 100 top global brands and enterprises trust Varnish Software in helping them meet their application performance and content delivery needs. Varnish Software maintains its own proprietary branch of Varnish Cache and a line of Varnish based products and solutions.
At Varnish Software, we take pride in our software and products and we value innovation. We strive to hire team members who share these values. We offer an open, honest, and international culture in a laid back and stimulating work environment. You will be working with some of the most brightest and talented people in the industry. We offer competitive salaries, full benefits, generous vacation time, and much more.
We are currently looking for a Software Engineer to join our teams in New York City and London.
Job description:
* Create, develop and maintain Varnish products and solutions
* Provide technical guidance and industry best practices to customers
* Interact with prospects during the sales process
* Hacking on various projects (side projects encouraged)
* International travel for customer meetings, conferences, and office workshops
Desired skills and experience:
* Experience with Varnish Cache and VCL
* Experience with C, scripting languages, Linux programming
* Good understanding of TCP and HTTP protocols and troubleshooting tools
* Comfortable explaining technical solutions and details to a non-technical audience
* Public speaking or writing experience is a plus
To apply, please send your resume or questions to jobs@varnish-software.com
https://access.redhat.com/documentation/en-us/red_hat_enterp...
Edit: the key comes from the user, its not stored anywhere on a server. The key can optionally never leave the user's device.
Varnish Software is the company behind Varnish Cache, the popular open source caching proxy. Looking for a full time onsite engineer who is comfortable working with Varnish Cache and VCL, C, Linux, HTTP and with client facing interactions. Full benefits offered.
If you are interested, please email: reza AT varnish-software DOT com