To play with Memcached over Telnet, connect to its TCP listener (commonly localhost 11211), send Basic Text Protocol commands with CRLF line endings, and provide an exact byte count plus a data line for storage operations. The essential sequence is set a value, get it back, inspect the server with stats, and use conditional commands such as add, replace or cas when existence and concurrency matter.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
This reference explains the wire format, every commonly used command, the responses you should see, and the mistakes that most often derail an interactive session.
As an Amazon Associate I earn from qualifying purchases.
Free tools Windows power users keep installed
One-click scans. No signup required.
What Memcached exposes through Telnet
Memcached is an in-memory key-value store for small chunks of arbitrary data such as strings, serialized objects, database results, API responses or rendered pages. Telnet does not provide a special management shell; it opens a TCP connection and lets you type the Memcached Basic Text Protocol directly.
The usual local connection is:
telnet localhost 11211
A successful connection looks like this:
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
The server expects each command line to end in carriage return plus line feed (CRLF). Storage commands then send a second line containing the value bytes, also terminated by CRLF. The protocol is byte-oriented, so the length field must match the payload exactly, not merely the number of visible characters in an encoding with multibyte characters.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
Item fields and limits
| Field | Meaning |
|---|---|
| Key | Up to 250 bytes in the Basic Text Protocol; spaces and newlines are not allowed. |
| Flags | A 32-bit application-defined value returned with the item. |
| Expiration | 0 means no expiration. Values through 30 days are relative seconds; larger values are interpreted as Unix timestamps. |
| CAS value | A 64-bit token used by gets and cas to prevent lost updates. |
| Data | Arbitrary bytes whose length is supplied in the command. |
Connect and frame commands correctly
Once Telnet is connected, enter one command at a time. The general storage form is:
<command> <key> <flags> <exptime> <bytes>rn
<data bytes>rn
Compare-and-set adds the token after the byte count:
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallcas <key> <flags> <exptime> <bytes> <cas unique>rn
<data bytes>rn
For an ASCII value, count the characters you send. For binary or multibyte data, count bytes. A wrong count makes the server wait for more data or interpret part of the next command as payload. During troubleshooting, do not use noreply; seeing each response keeps the request and response streams aligned.
Play with telnet: set and get
Store a value with set
set creates a key or overwrites an existing key. This example stores five bytes for 300 seconds:
set greeting 0 300 5rn
hellorn
STOREDrn
The fields mean key greeting, flags 0, relative expiration 300, and a five-byte payload.
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
Read it with get
get accepts one or more keys. Each hit has a VALUE header, the payload, and finally END:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
get greetingrn
VALUE greeting 0 5rn
hellorn
ENDrn
The header format is VALUE key flags bytes. A miss produces only END. With multiple keys, the server emits a block for each hit and one terminating END.
Conditional storage commands
add: store only when absent
add succeeds only if the key does not currently exist, which makes it useful for one-time initialization or lock-like markers:
add lock 0 60 4rn
busyrn
STOREDrn
add lock 0 60 5rn
againrn
NOT_STOREDrn
The second operation fails because lock is already present. It does not overwrite the existing value.
replace: store only when present
replace has the opposite existence rule. It updates an existing key and fails when no item is found:
Recommended Free Tools
Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
replace greeting 0 300 5rn
hellorn
STOREDrn
replace missing 0 300 5rn
hellorn
NOT_STOREDrn
append and prepend
These commands modify the existing data bytes. They retain the item’s current flags and expiration; the command does not accept replacement metadata. Both require the key to exist.
append greeting 0 0 6rn
worldrn
STOREDrn
prepend greeting 0 0 5rn
Say: rn
STOREDrn
get greetingrn
VALUE greeting 0 16rn
Say: hello worldrn
ENDrn
After appending six bytes to hello, the value is hello world (11 bytes). Prepending the five-byte string Say: produces 16 bytes, so the retrieval header correctly reports 16.
Safe concurrent updates with gets and cas
A read-modify-write sequence can lose an update if two clients read the same value. gets returns the current CAS identifier along with the item. Send that identifier to cas; the write succeeds only if no other client has changed the item since the read.
gets greetingrn
VALUE greeting 0 16 42rn
Say: hello worldrn
ENDrn
cas greeting 0 300 16 42rn
Say: hello againrn
STOREDrn
The payload Say: hello again is 16 bytes, so the command uses 16. If another write has advanced the CAS value, the old token is rejected with EXISTS. Fetch a fresh token with gets before retrying. A missing key causes a not-found response rather than a successful compare-and-set.
Delete a key
delete removes one item when it exists:
delete greetingrn
DELETEDrn
delete greetingrn
NOT_FOUNDrn
The second command reports that the key is already absent. Deletion does not affect unrelated keys.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
Numeric counters with incr and decr
Counters operate on an existing value containing an unsigned 64-bit decimal integer. They do not create a missing key, and the stored value must contain only a valid decimal number.
set hits 0 3600 1rn
0rn
STOREDrn
incr hits 1rn
1rn
decr hits 1rn
0rn
The argument after the key is the amount to add or subtract. If the key is missing, the result is NOT_FOUND; initialize it with set first. Decrement underflow clamps at zero. Increment overflow wraps at 64 bits, so applications that need stricter bounds must enforce them themselves.
Inspect the server with stats
General statistics
Send stats to receive counters and settings as STAT name value lines terminated by END:
statsrn
STAT pid 1234rn
STAT uptime 456rn
ENDrn
The exact set of fields depends on the running Memcached version and configuration. Treat the names and values as server-reported data rather than assumptions about a particular build.
Items and slabs
stats items summarizes items by slab class, while stats slabs reports slab allocation details:
Best Value
stats itemsrn
stats slabsrn
stats sizes is a development-oriented command. Documentation warns that it may lock a busy instance, so avoid it on a production server under load unless you understand the impact.
Invalidate cached data with flush_all
flush_all invalidates existing items immediately:
flush_allrn
OKrn
You can delay invalidation by supplying a number of seconds, for example flush_all 60. This makes cached entries expire after 60 seconds. It does not itself free memory or pause the server, and it affects every item visible to that Memcached instance, so use it deliberately.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Close the session
Type quit to close the interactive protocol session:
quitrn
You can also use Telnet’s escape sequence (usually Ctrl-]) and then choose the client quit command. The Memcached quit command either closes the connection or returns the protocol’s simple response behavior.
Understand Memcached responses
| Response | Meaning | Typical cause |
|---|---|---|
STORED |
The storage operation succeeded. | set, successful add, replace or cas. |
NOT_STORED |
A conditional storage rule was not met. | add found an existing key, or replace found none. |
EXISTS |
The supplied CAS token is stale. | Another client changed the item after gets. |
NOT_FOUND |
The key is absent for the requested operation. | delete, incr, decr or a CAS update against a missing key. |
VALUE ... |
A retrieval hit; the following line is the payload. | get or gets. |
END |
The response list is complete. | Every get/gets response and many statistics commands. |
CLIENT_ERROR |
The request is malformed. | Bad syntax, an invalid key or incorrect framing. |
SERVER_ERROR |
The server encountered an internal failure. | A server-side problem rather than a normal conditional result. |
Telnet troubleshooting checklist
- Connection refused: verify that Memcached is running, that the host and TCP port are correct, and that a local or network firewall permits the connection.
- The server appears to hang after a storage command: check the byte count and send the complete payload followed by
CRLF. The server may still be waiting for bytes promised by the header. CLIENT_ERRORafter a key command: remove spaces or newlines from the key, check spelling and field order, and keep the key within 250 bytes.NOT_FOUNDfrom a counter: initialize the key withset;incranddecrnever create counters.EXISTSfromcas: repeatgets, use the newly returned CAS token, and recalculate the payload byte count.- Unexpected output after an error: start a fresh connection and omit
noreplywhile diagnosing. Suppressing responses can leave an interactive client unable to determine which reply belongs to which command. - A retrieval length does not match your text: count bytes, not visual glyphs, and remember that
appendandprependpreserve the original item’s metadata.
Protocol version context
This article uses the Basic Text Protocol because it is the format you can exercise directly with Telnet. Memcached also documents a newer Meta Text Protocol for more advanced operations. The older binary protocol is deprecated. Check the documentation for the exact version running on your server before relying on command availability beyond the Basic Text commands shown here.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →

