Connect with us
[crypto-donation-box]

Blockchain

Scaling connections with Ruby and MongoDB

Republished by Plato

Published

on

Coinbase

By Michael de Hoog

Coinbase was launched 8 years ago as a Ruby on Rails app using MongoDB as its primary data store. Today, the primary paved-road language at Coinbase is Golang, but we continue to run and maintain the original Rails monolith, deployed at large scale with data stored across many MongoDB clusters.

This blog post outlines some scaling issues connecting from a Rails app to MongoDB, and how a recent change to our database connection management solved some of these issues.

Global VM Lock

At Coinbase we run our Ruby applications using CRuby (aka Ruby MRI). CRuby uses a Global VM Lock (GVL) to synchronize threads so that only a single thread can execute at once. This means a single Ruby process can only ever use a single CPU core at once, whether it runs a single thread or 100 threads.

Coinbase.com runs on machines with a large number of CPU cores. To fully utilize these cores, we spin up many CRuby processes, using a load-balancing parent process that allocates work across these child processes. In the application layer, it’s hard to share database connections between these processes, so instead each process has its own MongoDB connection pool that is shared by that process’ threads. This means each machine has 10–20K of outgoing connections to our MongoDB clusters.

Blue-green deploys

Maintaining product velocity is essential at Coinbase. We deploy to production hundreds of times a day across our fleet. In the general case we use blue-green deployments, spinning up a new set of instances for each deploy, waiting for these instances to report healthy, before shutting down the instances from the previous deploy.

This blue-green deploy approach means we have 2x the count of server instances during these deploys. It also means 2x the count of connections to MongoDB.

Connection storms

The large count of connections from each instance, combined with the amount of instances being created during deploys, leads to our application opening tens of thousands of connections to each MongoDB cluster. Deploying during high traffic periods, when our application is auto-scaled up to handle incoming traffic, we would see spikes of almost 60K connections in a single minute, or 1K per second.

Hoping to reduce some of this connection load on the database, in March we modified our deployment topology, introducing a routing layer designed to transfer this load from the `mongod` core database process to a `mongos` shard router process. Unfortunately the connections were similarly affecting the `mongos` process and didn’t resolve the problem.

We experienced various failure modes from these connection counts, including an unfortunate interaction where the Ruby driver could cause a connection storm on an already degraded database (this has since been fixed). This was seen during a prolonged incident in April, as described in this Post Mortem, where we saw connection attempts above MongoDB’s 128K maximum to a single host.

MongoDB connection attempts to a single cluster, grouped by replica set member

Proxying connections

The vast amount of connections from our Rails application is the root problem; we had to focus on reducing these. Analyzing the total time spent querying MongoDB demonstrated these connections went mostly unused; the application could serve the same amount of traffic with 5% of the current connection count. The obvious solution was some form of external connection pooling, similar to PgBouncer for PostgreSQL. While there was prior art, there was no currently supported solution for connection pooling for MongoDB.

We decided to prototype our own MongoDB connection proxy, which we call `mongobetween`. The requirements were simple: small + fast, with minimal complexity and state management. We wanted to avoid having to introduce a new layer in Rails, and didn’t want to reimplement MongoDB’s wire protocol.

`mongobetween` is written in Golang, and is designed to run as a sidecar alongside any application having trouble managing its own MongoDB connection count. It multiplexes the connections from the application across a small connection pool managed by the Golang MongoDB driver. It manages a small amount of state: a MongoDB cursorID -> server map, which it stores in an in-memory LRU cache.

Results

Since rolling out the connection proxy, we’ve dramatically reduced the overall count of outgoing connections to MongoDB, by around 20x. Deploy connection spikes which used to hit 30K now hit 1.5K connections. The application steady state, which used to require 10K connections per MongoDB router, now only needs 200–300 connections total:

MongoDB connections drop significantly May 21st after deploying the proxy

Open source

Today we’re announcing that we are open-sourcing the MongoDB connection proxy at github.com/coinbase/mongobetween. We would love to hear from you if you are experiencing similar MongoDB connection storm issues and would like to chat about our solution. If you’re interested in working on challenging availability problems and building the future of the cryptoeconomy, come join us.

Source: https://blog.coinbase.com/scaling-connections-with-ruby-and-mongodb-99204dbf8857?source=rss—-c114225aeaf7—4

Blockchain

Members of WallStreetBets Forum Alleged in Telegram Crypto Scam Stealing $2M in BNB and ETH

Republished by Plato

Published

on

Members of the popular WallStreetBets Reddit forum were suspected of a presumable cryptocurrency fraud that could have caused losses of no less than $2 million. By creating a designated Telegram group, they duped investors by guaranteeing remarkable returns through capitalizing on the recent crypto market rally.

The Core of the Hoax

Per a report by Bloomberg, alleged members of the WallStreetBets Reddit Forum used the Telegram messaging service to execute a blatant scam. A particular account by the name of ”WallStreetBets – Crypto Pumps” presented users the chance to purchase a new token certified as WSB Finance before it was listed on crypto exchanges. The operation is known as a pre-mine sale.

The essence of the fraud was connected to the recent cryptocurrency boom as bitcoin and most altcoins skyrocketed in value lately. With some of the digital assets reaching 1,000% gains, the targeted WSB members conned investors into sending money without asking questions and with the potential of netting huge profits.

The notorious account also urged users to transfer popular cryptocurrencies such as Binance Coin (BNB) and Ethereum (ETH) to a designated crypto wallet and then to reach its ”token bot” to gain WSB Finance coins.

However, the perpetrators never dispatched those coins. Furthermore, another message on Telegram revealed that the people who had already issued a payment had to send an equivalent amount again or they would risk losing their initial investment.


ADVERTISEMENT

The Aftermath

After executing the hoax, more than 3,451 Binance Coins were withdrawn on Tuesday (May, 4th) from the wallet inside the Crypto Pumps messages.

Since the price of BNB at that point was approximately $625, the fraud caused losses of more than $2.1 million. Following the scam, thousands of people expressed their frustration and tried to expose the individuals behind the account. Moreover, the quantity of the other cryptocurrency – ether – still remains a mystery.

Two weeks ago WSB admins warned about offers that might try to take advantage of the forum’s name in order to allure the crypto audience. The ”WallStreetBets – Crypto Pumps” account has been removed from Telegram but whoever managed it left a message that might stun the affected victims:

”Buying Lambo now.”

SPECIAL OFFER (Sponsored)

Binance Futures 50 USDT FREE Voucher: Use this link to register & get 10% off fees and 50 USDT when trading 500 USDT (limited offer).

PrimeXBT Special Offer: Use this link to register & enter POTATO50 code to get 50% free bonus on any deposit up to 1 BTC.

You Might Also Like:


Coinsmart. Beste Bitcoin-Börse in Europa
Source: https://cryptopotato.com/members-of-wallstreetbets-forum-alleged-in-telegram-crypto-scam-stealing-2m-in-bnb-and-eth/

Continue Reading

Blockchain

South Korean Crypto Exchange Accused Of $1.5 Billion Scam

Republished by Plato

Published

on

The South Korean cryptocurrency exchange platform V Global was accused of luring 40,000 people into illicit multi-level deceit. The entire scheme amounts to more than 1.7 million won, which equals $1.5 billion.

The Investigation

As reported by the Korean officials, the police raided many places in the country related to a virtual cryptocurrency exchange, and its notorious CEO – known as LEE – alleged to fundraising without regulatory permission. The authorities blocked the exchange’s cash deposits as a part of the investigation.

In total, the Gyeonggy Nambu Police Agency reported that it searched the exchange’s headquarters in southern Seoul along with 21 other places and froze more than $214 million left in the account.

Another report from today shed more light on the developments. According to Yonhap News, the name of the organization is V Global. The Korean police are examining the accusations against them for fraud under the Certain Economic Crimes Weighted Penalty Act, the Similar Receiving Act, and the door-to-door sales business.

The main accusation against the exchange is gaining a deposit of 1.7 trillion won ($1.5 billion) from 40,000 members in the period between August 2020 and January 2021. The announcement revealed that most of the people were elderly or housewives with no experience in cryptocurrency trading.


ADVERTISEMENT

Too Good To Be True

The investigation revealed that the exchange urged investors to entrust their funds to an account and lured the members that the expected return would be three times higher than the initial investment. According to the authorities, there was a pyramid element in the scam as the exchange promised to grant an introduction fee of 1.2 million won ($1,065) for every newly recruited member.

The report affirmed that the trading venue paid some members in the form of a block. Therefore, people who signed up earlier received funds from individuals who entered the exchange later.

Moreover, the Korean police seem confident to deal with the fraud case as it revealed its intention to confiscate 240 billion won ($214 million) left in the V Global account as of the 15th last month, even before the prosecution process.

SPECIAL OFFER (Sponsored)

Binance Futures 50 USDT FREE Voucher: Use this link to register & get 10% off fees and 50 USDT when trading 500 USDT (limited offer).

PrimeXBT Special Offer: Use this link to register & enter POTATO50 code to get 50% free bonus on any deposit up to 1 BTC.

You Might Also Like:


Coinsmart. Beste Bitcoin-Börse in Europa
Source: https://cryptopotato.com/south-korean-crypto-exchange-accused-of-1-5-billion-scam/

Continue Reading

Blockchain

Georgia’s central bank is exploring ‘Digital Gel’ CBDC

Republished by Plato

Published

on

The National Bank of Georgia said that it is considering launching a central bank digital currency.

In an announcement today, the central bank hinted at the issuance of a central bank digital currency, or CBDC, in an effort “to enhance efficiencies of the domestic payment system and financial inclusion.” The National Bank of Georgia, or NBG, said it would be inviting fintech firms and other financial institutions to participate in the project, named Digital Gel after the symbol for the country’s fiat currency, the lari.

“CBDC holds the promise to unlock the tremendous value of innovative business models for the benefit of society,” said the announcement. “The introduction of CBDC could increase financial intermediation efficiency, help introduce new financial technologies, facilitate financial inclusion, and reach previously unbanked populations.”

However, the bank mentioned the possibility of risks in the launch of a CBDC in the Republic of Georgia given the “new and potentially disruptive technology.” The NBG said it may conduct extensive testing of the CBDC in a controlled environment to ensure a smooth rollout, but did not provide any details regarding a timeline for launch.

With a population of roughly 4 million and a gross domestic product of approximately $15 billion, a nation like Georgia falls at the smaller end of countries exploring CBDCs. The Bahamas officially rolled out its Sand Dollar central bank digital currency in October, while China has been piloting its digital yuan in select cities prior to a full-scale launch. In the United States, Fortune 500 company Accenture announced this week it would be partnering with the Digital Dollar Foundation to conduct CBDC trials.

Coinsmart. Beste Bitcoin-Börse in Europa
Source: https://cointelegraph.com/news/georgia-s-central-bank-is-exploring-digital-gel-cbdc

Continue Reading
Blockchain2 days ago

Mastercard adds 6 blockchain payments startups to accelerator program

Blockchain5 days ago

dVPN network Sentinel initiates bandwidth sharing on the Cosmos IBC testnet

Blockchain5 days ago

Binance Smart Chain Partner Receives Funds From 16 Institutions

Blockchain5 days ago

Should Ethereum, Binance Coin, and FTT be part of traders’ portfolios?

Blockchain9 hours ago

Major Law Firm CMS Adds Stratis (STRAX) to its Legal Accelerator Program

Blockchain1 day ago

Starcoll To Issue Limited Edition Star Wars Collectibles as NFTs

Blockchain5 days ago

2 key Ethereum price metrics prove pro traders are behind ETH’s new highs

Blockchain1 day ago

Pro traders buy the Bitcoin price dip while retail investors chase altcoins

Blockchain2 days ago

S&P DJI Releases Bitcoin and Ethereum Indexes

Blockchain5 days ago

Crypto custodian Finoa closes $22M Series A funding round led by Balderton Capital

Blockchain22 hours ago

China’s Central Bank to Partner With Alibaba’s Ant Group on Digital Yuan

Blockchain2 days ago

Iranian companies can now pay for imports with officially mined cryptocurrencies.

Blockchain2 days ago

eBay could add a crypto payment option, says CEO

Blockchain2 days ago

CBDCs Could Harm Bitcoin But BTC May Replace Gold as a Store of Value: Deutsche Bank

Blockchain1 day ago

The Reason for Ethereum’s Recent Rally to ATH According to Changpeng Zhao

Blockchain1 day ago

‘This ain’t no game’ as DOGE briefly flippens Nintendo and takes #4 spot from XRP

Blockchain23 hours ago

Here Is Why XRP Volume Has Recover Across Payment Corridors

Blockchain5 days ago

bitHolla finalizes major upgrade on its white-label crypto exchange software

Blockchain1 day ago

Bybit Launches Ether (ETH) Cloud Mining Service as Demand Booms

Blockchain1 day ago

Another XRP lawsuit update: SEC accuses XRP Holders of ‘reciting’ Ripple’s litigation position

Trending